code: func (h *HookPayload) Branch() string {
  	ref := h.Ref
  	if h.ObjectAttributes != nil && len(h.ObjectAttributes.Ref) > 0 {
  		ref = h.ObjectAttributes.Ref
  	}
  
  	return strings.TrimPrefix(ref, "refs/heads/")
  }
docs: // Branch returns current branch for pipeline and push event hook
  // payload
  // This function returns empty string for any other events