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.
This commit is contained in:
Stefan Haller authored and Jesse Duffield committed 2026-02-07 20:29:07 +11:00
1 parent 2ae87d3d0f
commit f84cff3ba5
1 file changed
+10 -3
+10 -3
View File
@@ -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)