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 2025-10-13 18:38:45 +02:00 committed by Jesse Duffield
parent 2ae87d3d0f
commit f84cff3ba5

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)