aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2011-03-18 19:54:45 +0100
committerGuido Günther <agx@sigxcpu.org>2011-03-18 19:54:45 +0100
commitddf5ea3883723f9a64845511583b6dad8ff3600d (patch)
tree61a11f8059ae7210c7ae6f9be81dac7851728c97 /gbp
parente79dfe5563c13f5765c2cb352319ff8183a1a745 (diff)
gbp: Allow to pass cwd to git.__get_output()
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gbp/git.py b/gbp/git.py
index 3c2f1d1b..c0879fd7 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -39,14 +39,14 @@ class GitRepository(object):
env.update(extra_env)
return env
- def __git_getoutput(self, command, args=[], extra_env=None):
+ def __git_getoutput(self, command, args=[], extra_env=None, cwd=None):
"""exec a git command and return the output"""
output = []
env = self.__build_env(extra_env)
cmd = ['git', command] + args
log.debug(cmd)
- popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env)
+ popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env, cwd=cwd)
while popen.poll() == None:
output += popen.stdout.readlines()
ret = popen.poll()