From 62d0b10a7bea2aa5cb7593ff12d14c482a1a663c Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 5 Jun 2012 15:11:15 -0700 Subject: [PATCH] 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 --- git_command.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/git_command.py b/git_command.py index ea0053e3..634058f9 100644 --- a/git_command.py +++ b/git_command.py @@ -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)