diff options
author | Dave Borowitz <dborowitz@google.com> | 2013-09-25 17:46:01 -0700 |
---|---|---|
committer | Dave Borowitz <dborowitz@google.com> | 2013-09-25 17:46:01 -0700 |
commit | 0836a22d38f4fa29d3cbc543fcd7a42813ec052d (patch) | |
tree | c7baceadf54c9021ccc729180fab8c41b49990eb /project.py | |
parent | bc0308478bc98d9b14d0b8f79ad030f474adcc6f (diff) | |
download | git-repo-0836a22d38f4fa29d3cbc543fcd7a42813ec052d.tar.gz |
Wait for git-remote-persistent-https -print_config to exit
Change-Id: I5ab96e7c8575682217d440ddc52ecfdc8c35f179
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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. |