diff options
-rw-r--r-- | git.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -41,7 +41,7 @@ class EncodeWrapper: return s.decode(self.encoding, errors = self.errors) -def run_git(repo_path, params, stdin = None, silent_stderr = False): +def run_git(repo_path, params, stdin = None, silent_stderr = False, raw = False): """Invokes git with the given parameters. This function invokes git with the given parameters, and returns a @@ -63,6 +63,9 @@ def run_git(repo_path, params, stdin = None, silent_stderr = False): p.stdin.write(stdin) p.stdin.close() + if raw: + return p.stdout + # We need to wrap stdout if we want to decode it as utf8, subprocess # doesn't support us telling it the encoding. if sys.version_info.major == 3: |