summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorDaichi Ueura <daichi.ueura@sony.com>2018-02-26 08:49:36 +0900
committerDaichi Ueura <daichi.ueura@gmail.com>2018-02-26 08:53:08 +0900
commitce7e02601cfb0fdd0d9faa5cc2afa42717b63f1f (patch)
treedc1c471cbe118ccc12a033c37c169656597a7497 /git_config.py
parent685320b000c0683421a460d1c9a33ae9d73cc706 (diff)
downloadgit-repo-ce7e02601cfb0fdd0d9faa5cc2afa42717b63f1f.tar.gz
Take care of a tilde on cookie file path
This handles cookie file path like "~/.gitcookies". Change-Id: I87ba120a940fff38073d520f83b70654e6a239ba
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py7
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
558def _preconnect(url): 561def _preconnect(url):
559 m = URI_ALL.match(url) 562 m = URI_ALL.match(url)