diff options
| author | Daichi Ueura <daichi.ueura@sony.com> | 2018-02-26 08:49:36 +0900 |
|---|---|---|
| committer | Daichi Ueura <daichi.ueura@gmail.com> | 2018-02-26 08:53:08 +0900 |
| commit | ce7e02601cfb0fdd0d9faa5cc2afa42717b63f1f (patch) | |
| tree | dc1c471cbe118ccc12a033c37c169656597a7497 | |
| parent | 685320b000c0683421a460d1c9a33ae9d73cc706 (diff) | |
| download | git-repo-ce7e02601cfb0fdd0d9faa5cc2afa42717b63f1f.tar.gz | |
Take care of a tilde on cookie file path
This handles cookie file path like "~/.gitcookies".
Change-Id: I87ba120a940fff38073d520f83b70654e6a239ba
| -rw-r--r-- | git_config.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/git_config.py b/git_config.py index 3ba9dbd1..854b2387 100644 --- a/git_config.py +++ b/git_config.py | |||
| @@ -534,7 +534,7 @@ def GetUrlCookieFile(url, quiet): | |||
| 534 | for line in p.stdout: | 534 | for line in p.stdout: |
| 535 | line = line.strip() | 535 | line = line.strip() |
| 536 | if line.startswith(cookieprefix): | 536 | if line.startswith(cookieprefix): |
| 537 | cookiefile = line[len(cookieprefix):] | 537 | cookiefile = os.path.expanduser(line[len(cookieprefix):]) |
| 538 | if line.startswith(proxyprefix): | 538 | if line.startswith(proxyprefix): |
| 539 | proxy = line[len(proxyprefix):] | 539 | proxy = line[len(proxyprefix):] |
| 540 | # Leave subprocess open, as cookie file may be transient. | 540 | # Leave subprocess open, as cookie file may be transient. |
| @@ -553,7 +553,10 @@ def GetUrlCookieFile(url, quiet): | |||
| 553 | if e.errno == errno.ENOENT: | 553 | if e.errno == errno.ENOENT: |
| 554 | pass # No persistent proxy. | 554 | pass # No persistent proxy. |
| 555 | raise | 555 | raise |
| 556 | yield GitConfig.ForUser().GetString('http.cookiefile'), None | 556 | cookiefile = GitConfig.ForUser().GetString('http.cookiefile') |
| 557 | if cookiefile: | ||
| 558 | cookiefile = os.path.expanduser(cookiefile) | ||
| 559 | yield cookiefile, None | ||
| 557 | 560 | ||
| 558 | def _preconnect(url): | 561 | def _preconnect(url): |
| 559 | m = URI_ALL.match(url) | 562 | m = URI_ALL.match(url) |
