summaryrefslogtreecommitdiff
path: root/git.py
diff options
context:
space:
mode:
authorAlberto Bertogli <albertito@blitiri.com.ar>2012-11-11 14:39:41 +0100
committerAlberto Bertogli <albertito@blitiri.com.ar>2012-11-11 14:43:02 +0100
commitba3b2132f5ffa852579734a350104a719f654b64 (patch)
tree8509f1f67de3101b73a502c3b8610cea34121808 /git.py
parent1c729578b2c503b84a1cb78aefc4fda4845c672b (diff)
downloadgit-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.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/git.py b/git.py
index 023f1a6..d005b13 100644
--- a/git.py
+++ b/git.py
@@ -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()