fix(pr create): update error handling

This commit is contained in:
Kynan Ware 2025-03-10 13:06:16 -06:00
parent bab7dc650b
commit 54da786bec

View file

@ -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)