From be34946817dcf706c2f9448ebd50102472c552f6 Mon Sep 17 00:00:00 2001 From: Daniel Lublin Date: Tue, 12 Nov 2019 08:54:55 +0100 Subject: git-codereview: pick up URL-specific cookieFile config Example config: [http "https://go.googlesource.com"] cookiefile = ~/.gitcookies-googlesource The --get-urlmatch option falls back to non-URL-specific config. Fixes golang/go#35496 Change-Id: I2410ff5b55e2bf9214fcc2cad16095facec78434 Reviewed-on: https://go-review.googlesource.com/c/review/+/206697 Reviewed-by: Josh Bleecher Snyder Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot --- git-codereview/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-codereview/api.go b/git-codereview/api.go index 8440cb5..a3375ea 100644 --- a/git-codereview/api.go +++ b/git-codereview/api.go @@ -145,7 +145,7 @@ func loadAuth() { // First look in Git's http.cookiefile, which is where Gerrit // now tells users to store this information. - if cookieFile, _ := trimErr(cmdOutputErr("git", "config", "--path", "http.cookiefile")); cookieFile != "" { + if cookieFile, _ := trimErr(cmdOutputErr("git", "config", "--path", "--get-urlmatch", "http.cookiefile", auth.url)); cookieFile != "" { data, _ := ioutil.ReadFile(cookieFile) maxMatch := -1 for _, line := range lines(string(data)) { -- cgit v1.3