mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Use GIT_CONFIG_PARAMETERS instead of -c for http.proxy
Ancient versions of Git don't understand the -c command line flag that we tried to use to pass http_proxy down into Git on Darwin. Use the environment variable instead, to more gracefully degrade with these old versions. Change-Id: Iffffa32088c1fd803895b990b3377ecfec6a1b14
This commit is contained in:
parent
d666e93ecc
commit
62d0b10a7b
@ -147,6 +147,12 @@ class GitCommand(object):
|
||||
if ssh_proxy:
|
||||
_setenv(env, 'REPO_SSH_SOCK', ssh_sock())
|
||||
_setenv(env, 'GIT_SSH', _ssh_proxy())
|
||||
if 'http_proxy' in env and 'darwin' == sys.platform:
|
||||
s = 'http.proxy=' + env['http_proxy']
|
||||
p = env.get('GIT_CONFIG_PARAMETERS')
|
||||
if p is not None:
|
||||
s = p + ' ' + s
|
||||
_setenv(env, 'GIT_CONFIG_PARAMETERS', s)
|
||||
|
||||
if project:
|
||||
if not cwd:
|
||||
@ -155,8 +161,6 @@ class GitCommand(object):
|
||||
gitdir = project.gitdir
|
||||
|
||||
command = [GIT]
|
||||
if 'http_proxy' in env and 'darwin' == sys.platform:
|
||||
command.extend(['-c', 'http.proxy=' + env['http_proxy']])
|
||||
if bare:
|
||||
if gitdir:
|
||||
_setenv(env, GIT_DIR, gitdir)
|
||||
|
Loading…
Reference in New Issue
Block a user