diff options
Diffstat (limited to 'git_command.py')
| -rw-r--r-- | git_command.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/git_command.py b/git_command.py index 51e856a8..6e285224 100644 --- a/git_command.py +++ b/git_command.py | |||
| @@ -249,7 +249,7 @@ class GitCommand(object): | |||
| 249 | project, | 249 | project, |
| 250 | cmdv, | 250 | cmdv, |
| 251 | bare=False, | 251 | bare=False, |
| 252 | provide_stdin=False, | 252 | input=None, |
| 253 | capture_stdout=False, | 253 | capture_stdout=False, |
| 254 | capture_stderr=False, | 254 | capture_stderr=False, |
| 255 | merge_output=False, | 255 | merge_output=False, |
| @@ -298,11 +298,7 @@ class GitCommand(object): | |||
| 298 | command.append('--progress') | 298 | command.append('--progress') |
| 299 | command.extend(cmdv[1:]) | 299 | command.extend(cmdv[1:]) |
| 300 | 300 | ||
| 301 | if provide_stdin: | 301 | stdin = subprocess.PIPE if input else None |
| 302 | stdin = subprocess.PIPE | ||
| 303 | else: | ||
| 304 | stdin = None | ||
| 305 | |||
| 306 | stdout = subprocess.PIPE | 302 | stdout = subprocess.PIPE |
| 307 | stderr = subprocess.STDOUT if merge_output else subprocess.PIPE | 303 | stderr = subprocess.STDOUT if merge_output else subprocess.PIPE |
| 308 | 304 | ||
| @@ -350,7 +346,11 @@ class GitCommand(object): | |||
| 350 | _add_ssh_client(p) | 346 | _add_ssh_client(p) |
| 351 | 347 | ||
| 352 | self.process = p | 348 | self.process = p |
| 353 | self.stdin = p.stdin | 349 | if input: |
| 350 | if isinstance(input, str): | ||
| 351 | input = input.encode('utf-8') | ||
| 352 | p.stdin.write(input) | ||
| 353 | p.stdin.close() | ||
| 354 | 354 | ||
| 355 | @staticmethod | 355 | @staticmethod |
| 356 | def _GetBasicEnv(): | 356 | def _GetBasicEnv(): |
