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:
Shawn O. Pearce 2012-06-05 15:11:15 -07:00
parent d666e93ecc
commit 62d0b10a7b

View File

@ -147,6 +147,12 @@ class GitCommand(object):
if ssh_proxy: if ssh_proxy:
_setenv(env, 'REPO_SSH_SOCK', ssh_sock()) _setenv(env, 'REPO_SSH_SOCK', ssh_sock())
_setenv(env, 'GIT_SSH', _ssh_proxy()) _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 project:
if not cwd: if not cwd:
@ -155,8 +161,6 @@ class GitCommand(object):
gitdir = project.gitdir gitdir = project.gitdir
command = [GIT] command = [GIT]
if 'http_proxy' in env and 'darwin' == sys.platform:
command.extend(['-c', 'http.proxy=' + env['http_proxy']])
if bare: if bare:
if gitdir: if gitdir:
_setenv(env, GIT_DIR, gitdir) _setenv(env, GIT_DIR, gitdir)