diff options
Diffstat (limited to 'git-codereview/api.go')
| -rw-r--r-- | git-codereview/api.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/git-codereview/api.go b/git-codereview/api.go index da3fa76..9fc1b67 100644 --- a/git-codereview/api.go +++ b/git-codereview/api.go @@ -57,8 +57,10 @@ func loadGerritOrigin() { // Gerrit must be set, either explicitly via the code review config or // implicitly as Git's origin remote. - origin := config()["gerrit"] - originUrl := trim(cmdOutput("git", "config", "remote.origin.url")) + cfg := config() + cfgRemote := cfg["remote"] + origin := cfg["gerrit"] + originUrl := trim(cmdOutput("git", "config", "remote."+cfgRemote+".url")) err := loadGerritOriginInternal(origin, originUrl) if err != nil { @@ -73,7 +75,7 @@ func loadGerritOrigin() { func loadGerritOriginInternal(origin, remoteOrigin string) error { originUrl, err := url.Parse(remoteOrigin) if err != nil { - return fmt.Errorf("failed to parse git's remote.origin.url %q as a URL: %v", remoteOrigin, err) + return fmt.Errorf("failed to parse git's remote.%s.url %q as a URL: %v", cachedConfig["remote"], remoteOrigin, err) } else { originUrl.User = nil remoteOrigin = originUrl.String() |
