MCPcopy
hub / github.com/cli/cli / remoteForMergeConflictResolution

Function remoteForMergeConflictResolution

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

Source from the content-addressed store, hash-verified

742}
743
744func remoteForMergeConflictResolution(baseRepo ghrepo.Interface, pr *api.PullRequest, opts *MergeOptions) *ghContext.Remote {
745 if !mergeConflictStatus(pr.MergeStateStatus) || !opts.CanDeleteLocalBranch {
746 return nil
747 }
748 remotes, err := opts.Remotes()
749 if err != nil {
750 return nil
751 }
752 remote, err := remotes.FindByRepo(baseRepo.RepoOwner(), baseRepo.RepoName())
753 if err != nil {
754 return nil
755 }
756 return remote
757}
758
759func mergeConflictStatus(status string) bool {
760 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