From f84cff3ba5688345ef590493cbda420dfe3d297a Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 13 Oct 2025 18:38:45 +0200 Subject: [PATCH] WIP use origin remote I don't know what I'm doing here, but this seems to be needed to make it work for me. --- pkg/commands/git_commands/github.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/commands/git_commands/github.go b/pkg/commands/git_commands/github.go index d3d829951..3d32b59d8 100644 --- a/pkg/commands/git_commands/github.go +++ b/pkg/commands/git_commands/github.go @@ -423,12 +423,19 @@ func (self *GitHubCommands) GetBaseRepoOwnerAndName() (string, string, error) { return "", "", fmt.Errorf("No remotes found") } - firstRemote := remotes[0] - if len(firstRemote.Config().URLs) == 0 { + originRemote, ok := lo.Find(remotes, func(remote *gogit.Remote) bool { + return remote.Config().Name == "origin" + }) + + if !ok { + return "", "", fmt.Errorf("Origin remote not found") + } + + if len(originRemote.Config().URLs) == 0 { return "", "", fmt.Errorf("No URLs found for remote") } - url := firstRemote.Config().URLs[0] + url := originRemote.Config().URLs[0] repoInfo := getRepoInfoFromURL(url)