From cf58910ac0a2a7ee52b38b0a31c1eebae53db122 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Wed, 5 Mar 2025 16:11:50 -0700 Subject: [PATCH] refactor(pr create): named headRefName var --- pkg/cmd/pr/create/create.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index 762636797..45c7c4499 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -652,7 +652,8 @@ func NewCreateContext(opts *CreateOptions) (*CreateContext, error) { if prRefs.HeadRepo != nil && prRefs.BranchName != "" { headRemote, err := remotes.FindByRepo(prRefs.HeadRepo.RepoOwner(), prRefs.HeadRepo.RepoName()) if err == nil { - refsForLookup := []string{"HEAD", fmt.Sprintf("refs/remotes/%s/%s", headRemote, prRefs.BranchName)} + headRefName := fmt.Sprintf("refs/remotes/%s/%s", headRemote, prRefs.BranchName) + refsForLookup := []string{"HEAD", headRefName} resolvedRefs, err := gitClient.ShowRefs(context.Background(), refsForLookup) // If there is more than one resolved ref, then remote head ref was resolved. @@ -672,7 +673,7 @@ func NewCreateContext(opts *CreateOptions) (*CreateContext, error) { var forkHeadRepo bool var isPushEnabled bool - + if promptForHeadRepo && opts.IO.CanPrompt() { isPushEnabled = true // Since we could not determine a head ref, prompt the user for the head repository to push