From 54da786bec22bb64f298bacb1b72a721ddca2f24 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Mon, 10 Mar 2025 13:06:16 -0600 Subject: [PATCH] fix(pr create): update error handling --- pkg/cmd/pr/create/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index 46f3db8af..dc89542e5 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -652,7 +652,7 @@ func NewCreateContext(opts *CreateOptions) (*CreateContext, error) { if prRefs.HeadRepo != nil && prRefs.BranchName != "" { // Check if the head branch is up-to-date with the local branch headRemote, err := remotes.FindByRepo(prRefs.HeadRepo.RepoOwner(), prRefs.HeadRepo.RepoName()) - if err == nil { + if headRemote != nil && err == nil { headRefName := fmt.Sprintf("refs/remotes/%s/%s", headRemote, prRefs.BranchName) refsForLookup := []string{"HEAD", headRefName} resolvedRefs, err := gitClient.ShowRefs(context.Background(), refsForLookup)