1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-30 23:57:43 +02:00

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
parent 3005d806b0
commit 8c9a076179

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)