summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-10-21 21:04:29 +0200
committerGuido Günther <agx@sigxcpu.org>2011-10-21 21:11:01 +0200
commit8ed66f116d1fa8f665fb4e5aa59c4303867d39b2 (patch)
tree4a1167a463ad53470b5d892032f95d986037fb62 /gbp
parent2eafa6aeb540c788a6d0c89aa1cfc8bed7ebb360 (diff)
Add _git_command that executes a command at the repo's path
making explicit path checking superfluous. Git-Dch: Ignore
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/gbp/git.py b/gbp/git.py
index c51f420..19f63bc 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -78,6 +78,17 @@ class GitRepository(object):
(stdout, stderr) = popen.communicate(input)
return stdout, stderr, popen.returncode
+ def _git_command(self, command, args=[], extra_env=None):
+ """
+ Execute git command with arguments args and environment env
+ at path.
+
+ @param command: git command
+ @param args: command line arguments
+ @extra_env: extra environment variables to set when running command
+ """
+ GitCommand(command, args, extra_env=extra_env, cwd=self.path)()
+
def base_dir(self):
"""Base of the repository"""
return os.path.join(self.path, '.git')