summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2013-09-26 16:30:01 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-09-26 16:30:02 +0000
commit70df18944a667329ec894a1df1e77381c5b0c09a (patch)
treefaff1670b73fb87ec417f79ff0cf2309274bb23e
parentb6a16e6390b12b019a7e5e297639e41310375c93 (diff)
parent0836a22d38f4fa29d3cbc543fcd7a42813ec052d (diff)
downloadgit-repo-70df18944a667329ec894a1df1e77381c5b0c09a.tar.gz
Merge "Wait for git-remote-persistent-https -print_config to exit"
-rw-r--r--project.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/project.py b/project.py
index bc997e78..cbc3c219 100644
--- a/project.py
+++ b/project.py
@@ -1831,17 +1831,22 @@ class Project(object):
1831 ['git-remote-persistent-https', '-print_config', url], 1831 ['git-remote-persistent-https', '-print_config', url],
1832 stdin=subprocess.PIPE, stdout=subprocess.PIPE, 1832 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
1833 stderr=subprocess.PIPE) 1833 stderr=subprocess.PIPE)
1834 p.stdin.close() # Tell subprocess it's ok to close.
1834 prefix = 'http.cookiefile=' 1835 prefix = 'http.cookiefile='
1836 cookiefile = None
1835 for line in p.stdout: 1837 for line in p.stdout:
1836 line = line.strip() 1838 line = line.strip()
1837 if line.startswith(prefix): 1839 if line.startswith(prefix):
1838 return line[len(prefix):] 1840 cookiefile = line[len(prefix):]
1841 break
1839 if p.wait(): 1842 if p.wait():
1840 line = iter(p.stderr).next() 1843 line = iter(p.stderr).next()
1841 if ' -print_config' in line: 1844 if ' -print_config' in line:
1842 pass # Persistent proxy doesn't support -print_config. 1845 pass # Persistent proxy doesn't support -print_config.
1843 else: 1846 else:
1844 print(line + p.stderr.read(), file=sys.stderr) 1847 print(line + p.stderr.read(), file=sys.stderr)
1848 if cookiefile:
1849 return cookiefile
1845 except OSError as e: 1850 except OSError as e:
1846 if e.errno == errno.ENOENT: 1851 if e.errno == errno.ENOENT:
1847 pass # No persistent proxy. 1852 pass # No persistent proxy.