summaryrefslogtreecommitdiff
path: root/gbp/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/git.py')
-rw-r--r--gbp/git.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/gbp/git.py b/gbp/git.py
index f52b09b..8c0debf 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -388,14 +388,20 @@ class GitRepository(object):
self._git_command("branch", args)
- def delete_branch(self, branch):
+ def delete_branch(self, branch, remote=False):
"""
Delete branch 'branch'
@param branch: name of the branch to delete
+ @type branch: string
+ @param remote: delete a remote branch
+ @param remote: bool
"""
+ args = [ "-D" ]
+ args += [ "-r" ] if remote else []
+
if self.get_branch() != branch:
- self._git_command("branch", ["-D", branch])
+ self._git_command("branch", args + [branch])
else:
raise GitRepositoryError, "Can't delete the branch you're on"