diff options
Diffstat (limited to 'git_command.py')
| -rw-r--r-- | git_command.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/git_command.py b/git_command.py index fabad0e0..04953f38 100644 --- a/git_command.py +++ b/git_command.py | |||
| @@ -21,7 +21,6 @@ from error import GitError | |||
| 21 | from git_refs import HEAD | 21 | from git_refs import HEAD |
| 22 | import platform_utils | 22 | import platform_utils |
| 23 | from repo_trace import REPO_TRACE, IsTrace, Trace | 23 | from repo_trace import REPO_TRACE, IsTrace, Trace |
| 24 | import ssh | ||
| 25 | from wrapper import Wrapper | 24 | from wrapper import Wrapper |
| 26 | 25 | ||
| 27 | GIT = 'git' | 26 | GIT = 'git' |
| @@ -167,7 +166,7 @@ class GitCommand(object): | |||
| 167 | capture_stderr=False, | 166 | capture_stderr=False, |
| 168 | merge_output=False, | 167 | merge_output=False, |
| 169 | disable_editor=False, | 168 | disable_editor=False, |
| 170 | ssh_proxy=False, | 169 | ssh_proxy=None, |
| 171 | cwd=None, | 170 | cwd=None, |
| 172 | gitdir=None): | 171 | gitdir=None): |
| 173 | env = self._GetBasicEnv() | 172 | env = self._GetBasicEnv() |
| @@ -175,8 +174,8 @@ class GitCommand(object): | |||
| 175 | if disable_editor: | 174 | if disable_editor: |
| 176 | env['GIT_EDITOR'] = ':' | 175 | env['GIT_EDITOR'] = ':' |
| 177 | if ssh_proxy: | 176 | if ssh_proxy: |
| 178 | env['REPO_SSH_SOCK'] = ssh.sock() | 177 | env['REPO_SSH_SOCK'] = ssh_proxy.sock() |
| 179 | env['GIT_SSH'] = ssh.proxy() | 178 | env['GIT_SSH'] = ssh_proxy.proxy |
| 180 | env['GIT_SSH_VARIANT'] = 'ssh' | 179 | env['GIT_SSH_VARIANT'] = 'ssh' |
| 181 | if 'http_proxy' in env and 'darwin' == sys.platform: | 180 | if 'http_proxy' in env and 'darwin' == sys.platform: |
| 182 | s = "'http.proxy=%s'" % (env['http_proxy'],) | 181 | s = "'http.proxy=%s'" % (env['http_proxy'],) |
| @@ -259,7 +258,7 @@ class GitCommand(object): | |||
| 259 | raise GitError('%s: %s' % (command[1], e)) | 258 | raise GitError('%s: %s' % (command[1], e)) |
| 260 | 259 | ||
| 261 | if ssh_proxy: | 260 | if ssh_proxy: |
| 262 | ssh.add_client(p) | 261 | ssh_proxy.add_client(p) |
| 263 | 262 | ||
| 264 | self.process = p | 263 | self.process = p |
| 265 | if input: | 264 | if input: |
| @@ -271,7 +270,8 @@ class GitCommand(object): | |||
| 271 | try: | 270 | try: |
| 272 | self.stdout, self.stderr = p.communicate() | 271 | self.stdout, self.stderr = p.communicate() |
| 273 | finally: | 272 | finally: |
| 274 | ssh.remove_client(p) | 273 | if ssh_proxy: |
| 274 | ssh_proxy.remove_client(p) | ||
| 275 | self.rc = p.wait() | 275 | self.rc = p.wait() |
| 276 | 276 | ||
| 277 | @staticmethod | 277 | @staticmethod |
