diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-10-21 21:04:29 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-10-21 21:11:01 +0200 |
commit | 8ed66f116d1fa8f665fb4e5aa59c4303867d39b2 (patch) | |
tree | 4a1167a463ad53470b5d892032f95d986037fb62 /gbp | |
parent | 2eafa6aeb540c788a6d0c89aa1cfc8bed7ebb360 (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.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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') |