summaryrefslogtreecommitdiffstats
path: root/git_command.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2012-06-05 15:11:15 -0700
committerShawn O. Pearce <sop@google.com>2012-06-05 15:11:15 -0700
commit62d0b10a7bea2aa5cb7593ff12d14c482a1a663c (patch)
treec03c28ee9e272f1349e135b0259ed919602e4484 /git_command.py
parentd666e93ecc1f094774dfc7ba9ab0fd6e1695e976 (diff)
downloadgit-repo-62d0b10a7bea2aa5cb7593ff12d14c482a1a663c.tar.gz
Use GIT_CONFIG_PARAMETERS instead of -c for http.proxyv1.9.3
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
Diffstat (limited to 'git_command.py')
-rw-r--r--git_command.py8
1 files 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):
147 if ssh_proxy: 147 if ssh_proxy:
148 _setenv(env, 'REPO_SSH_SOCK', ssh_sock()) 148 _setenv(env, 'REPO_SSH_SOCK', ssh_sock())
149 _setenv(env, 'GIT_SSH', _ssh_proxy()) 149 _setenv(env, 'GIT_SSH', _ssh_proxy())
150 if 'http_proxy' in env and 'darwin' == sys.platform:
151 s = 'http.proxy=' + env['http_proxy']
152 p = env.get('GIT_CONFIG_PARAMETERS')
153 if p is not None:
154 s = p + ' ' + s
155 _setenv(env, 'GIT_CONFIG_PARAMETERS', s)
150 156
151 if project: 157 if project:
152 if not cwd: 158 if not cwd:
@@ -155,8 +161,6 @@ class GitCommand(object):
155 gitdir = project.gitdir 161 gitdir = project.gitdir
156 162
157 command = [GIT] 163 command = [GIT]
158 if 'http_proxy' in env and 'darwin' == sys.platform:
159 command.extend(['-c', 'http.proxy=' + env['http_proxy']])
160 if bare: 164 if bare:
161 if gitdir: 165 if gitdir:
162 _setenv(env, GIT_DIR, gitdir) 166 _setenv(env, GIT_DIR, gitdir)