diff options
author | Alberto Bertogli <albertito@blitiri.com.ar> | 2012-11-11 14:39:41 +0100 |
---|---|---|
committer | Alberto Bertogli <albertito@blitiri.com.ar> | 2012-11-11 14:43:02 +0100 |
commit | ba3b2132f5ffa852579734a350104a719f654b64 (patch) | |
tree | 8509f1f67de3101b73a502c3b8610cea34121808 /git.py | |
parent | 1c729578b2c503b84a1cb78aefc4fda4845c672b (diff) | |
download | git-arr-fork-ba3b2132f5ffa852579734a350104a719f654b64.zip |
Improve the way we find repo paths
This patch improves the way we find the path to the repositories, both in the
recursive and in the non-recursive cases.
We now support specifying non-bare repositories directly, and also recursing
on them.
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Diffstat (limited to 'git.py')
-rw-r--r-- | git.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -41,7 +41,7 @@ class EncodeWrapper: return s.decode(self.encoding, errors = self.errors) -def run_git(repo_path, params, stdin = None): +def run_git(repo_path, params, stdin = None, silent_stderr = False): """Invokes git with the given parameters. This function invokes git with the given parameters, and returns a @@ -49,11 +49,17 @@ def run_git(repo_path, params, stdin = None): """ params = [GIT_BIN, '--git-dir=%s' % repo_path] + list(params) + stderr = None + if silent_stderr: + stderr = subprocess.PIPE + if not stdin: - p = subprocess.Popen(params, stdin = None, stdout = subprocess.PIPE) + p = subprocess.Popen(params, + stdin = None, stdout = subprocess.PIPE, stderr = stderr) else: p = subprocess.Popen(params, - stdin = subprocess.PIPE, stdout = subprocess.PIPE) + stdin = subprocess.PIPE, stdout = subprocess.PIPE, + stderr = stderr) p.stdin.write(stdin) p.stdin.close() |