MCPcopy Create free account
hub / github.com/cli/cli / remoteForMergeConflictResolution

Function remoteForMergeConflictResolution

pkg/cmd/pr/merge/merge.go:807–820  ·  view source on GitHub ↗
(baseRepo ghrepo.Interface, pr *api.PullRequest, opts *MergeOptions)

Source from the content-addressed store, hash-verified

805}
806
807func remoteForMergeConflictResolution(baseRepo ghrepo.Interface, pr *api.PullRequest, opts *MergeOptions) *ghContext.Remote {
808 if !mergeConflictStatus(pr.MergeStateStatus) || !opts.CanDeleteLocalBranch {
809 return nil
810 }
811 remotes, err := opts.Remotes()
812 if err != nil {
813 return nil
814 }
815 remote, err := remotes.FindByRepo(baseRepo.RepoOwner(), baseRepo.RepoName())
816 if err != nil {
817 return nil
818 }
819 return remote
820}
821
822func mergeConflictStatus(status string) bool {
823 return status == MergeStateStatusDirty

Callers 1

canMergeMethod · 0.85

Calls 5

mergeConflictStatusFunction · 0.85
FindByRepoMethod · 0.80
RemotesMethod · 0.65
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65

Tested by

no test coverage detected