From ddf5ea3883723f9a64845511583b6dad8ff3600d Mon Sep 17 00:00:00 2001 From: Sean Finney Date: Fri, 18 Mar 2011 19:54:45 +0100 Subject: gbp: Allow to pass cwd to git.__get_output() --- gbp/git.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gbp') 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() -- cgit v1.2.3