mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Merge "Wait for git-remote-persistent-https -print_config to exit"
This commit is contained in:
commit
70df18944a
@ -1831,17 +1831,22 @@ class Project(object):
|
|||||||
['git-remote-persistent-https', '-print_config', url],
|
['git-remote-persistent-https', '-print_config', url],
|
||||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
p.stdin.close() # Tell subprocess it's ok to close.
|
||||||
prefix = 'http.cookiefile='
|
prefix = 'http.cookiefile='
|
||||||
|
cookiefile = None
|
||||||
for line in p.stdout:
|
for line in p.stdout:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if line.startswith(prefix):
|
if line.startswith(prefix):
|
||||||
return line[len(prefix):]
|
cookiefile = line[len(prefix):]
|
||||||
|
break
|
||||||
if p.wait():
|
if p.wait():
|
||||||
line = iter(p.stderr).next()
|
line = iter(p.stderr).next()
|
||||||
if ' -print_config' in line:
|
if ' -print_config' in line:
|
||||||
pass # Persistent proxy doesn't support -print_config.
|
pass # Persistent proxy doesn't support -print_config.
|
||||||
else:
|
else:
|
||||||
print(line + p.stderr.read(), file=sys.stderr)
|
print(line + p.stderr.read(), file=sys.stderr)
|
||||||
|
if cookiefile:
|
||||||
|
return cookiefile
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == errno.ENOENT:
|
if e.errno == errno.ENOENT:
|
||||||
pass # No persistent proxy.
|
pass # No persistent proxy.
|
||||||
|
Loading…
Reference in New Issue
Block a user