Don't use pointer for determineTrackingBranch branchConfig
This commit is contained in:
parent
dc077dc09b
commit
05764b8114
2 changed files with 3 additions and 3 deletions
|
|
@ -518,7 +518,7 @@ func initDefaultTitleBody(ctx CreateContext, state *shared.IssueMetadataState, u
|
|||
return nil
|
||||
}
|
||||
|
||||
func determineTrackingBranch(gitClient *git.Client, remotes ghContext.Remotes, localBranchName string, headBranchConfig *git.BranchConfig) *git.TrackingRef {
|
||||
func determineTrackingBranch(gitClient *git.Client, remotes ghContext.Remotes, localBranchName string, headBranchConfig git.BranchConfig) *git.TrackingRef {
|
||||
// To try and determine the tracking ref for a local branch, we first construct a collection of refs
|
||||
// that might be tracking, given the current branch's config, and the list of known remotes.
|
||||
refsForLookup := []string{"HEAD"}
|
||||
|
|
@ -663,7 +663,7 @@ func NewCreateContext(opts *CreateOptions) (*CreateContext, error) {
|
|||
headBranchConfig := gitClient.ReadBranchConfig(context.Background(), headBranch)
|
||||
if isPushEnabled {
|
||||
// determine whether the head branch is already pushed to a remote
|
||||
if pushedTo := determineTrackingBranch(gitClient, remotes, headBranch, &headBranchConfig); pushedTo != nil {
|
||||
if pushedTo := determineTrackingBranch(gitClient, remotes, headBranch, headBranchConfig); pushedTo != nil {
|
||||
isPushEnabled = false
|
||||
if r, err := remotes.FindByName(pushedTo.RemoteName); err == nil {
|
||||
headRepo = r
|
||||
|
|
|
|||
|
|
@ -1719,7 +1719,7 @@ func Test_determineTrackingBranch(t *testing.T) {
|
|||
GitPath: "some/path/git",
|
||||
}
|
||||
headBranchConfig := gitClient.ReadBranchConfig(ctx.Background(), "feature")
|
||||
ref := determineTrackingBranch(gitClient, tt.remotes, "feature", &headBranchConfig)
|
||||
ref := determineTrackingBranch(gitClient, tt.remotes, "feature", headBranchConfig)
|
||||
tt.assert(ref, t)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue