func (ghc *GitHubContext) Branches() (base string, head string, err error) {
	if err := ghc.ensurePRCached(); err != nil {
		return "", "", errors.Wrap(err, "failed to get branches")
	}

	base = ghc.pr.GetBase().GetRef()

	if ghc.pr.GetHead().GetRepo().GetID() == ghc.pr.GetBase().GetRepo().GetID() {
		head = ghc.pr.GetHead().GetRef()
	} else {
		head = ghc.pr.GetHead().GetLabel()
	}

	return
}
// Branches returns the names of the base and head branch. If the head branch is from another repository (it is a fork)
// then the branch name is `owner:branchName`.
Branches returns the names of the base and head branch. If the head branch is from another repository (it is a fork)
then the branch name is `owner:branchName`.
// Branches returns the names of the base and head branch . If the head branch is from another repository ( it is a fork ) // then the branch name is ` owner : branchName ` .
func (ghc *GitHubContext) Branches() (base string, head string, err error) {
	if err := ghc.ensurePRCached(); err != nil {
		return "", "", errors.Wrap(err, "failed to get branches")
	}
	base = ghc.pr.GetBase().GetRef()
	if ghc.pr.GetHead().GetRepo().GetID() == ghc.pr.GetBase().GetRepo().GetID() {
		head = ghc.pr.GetHead().GetRef()
	} else {
		head = ghc.pr.GetHead().GetLabel()
	}
	return
}
func ( ghc * GitHubContext ) Branches ( ) ( base string , head string , err error ) { if err := ghc . ensurePRCached ( ) ; err != nil { return " " , " " , errors . Wrap ( err , " " ) } base = ghc . pr . GetBase ( ) . GetRef ( ) if ghc . pr . GetHead ( ) . GetRepo ( ) . GetID ( ) == ghc . pr . GetBase ( ) . GetRepo ( ) . GetID ( ) { head = ghc . pr . GetHead ( ) . GetRef ( ) } else { head = ghc . pr . GetHead ( ) . GetLabel ( ) } return }
Branches returns the names of the base and head branch.
Branches returns the names of the base and head branch .