diff options
Diffstat (limited to 'git_command.py')
| -rw-r--r-- | git_command.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/git_command.py b/git_command.py index 181e3724..513b9ebf 100644 --- a/git_command.py +++ b/git_command.py | |||
| @@ -112,6 +112,9 @@ def git_require(min_version, fail=False): | |||
| 112 | sys.exit(1) | 112 | sys.exit(1) |
| 113 | return False | 113 | return False |
| 114 | 114 | ||
| 115 | def _setenv(env, name, value): | ||
| 116 | env[name] = value.encode() | ||
| 117 | |||
| 115 | class GitCommand(object): | 118 | class GitCommand(object): |
| 116 | def __init__(self, | 119 | def __init__(self, |
| 117 | project, | 120 | project, |
| @@ -137,10 +140,10 @@ class GitCommand(object): | |||
| 137 | del env[e] | 140 | del env[e] |
| 138 | 141 | ||
| 139 | if disable_editor: | 142 | if disable_editor: |
| 140 | env['GIT_EDITOR'] = ':' | 143 | _setenv(env, 'GIT_EDITOR', ':') |
| 141 | if ssh_proxy: | 144 | if ssh_proxy: |
| 142 | env['REPO_SSH_SOCK'] = ssh_sock() | 145 | _setenv(env, 'REPO_SSH_SOCK', ssh_sock()) |
| 143 | env['GIT_SSH'] = _ssh_proxy() | 146 | _setenv(env, 'GIT_SSH', _ssh_proxy()) |
| 144 | 147 | ||
| 145 | if project: | 148 | if project: |
| 146 | if not cwd: | 149 | if not cwd: |
| @@ -151,7 +154,7 @@ class GitCommand(object): | |||
| 151 | command = [GIT] | 154 | command = [GIT] |
| 152 | if bare: | 155 | if bare: |
| 153 | if gitdir: | 156 | if gitdir: |
| 154 | env[GIT_DIR] = gitdir | 157 | _setenv(env, GIT_DIR, gitdir) |
| 155 | cwd = None | 158 | cwd = None |
| 156 | command.extend(cmdv) | 159 | command.extend(cmdv) |
| 157 | 160 | ||
