aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-06-28 16:10:31 +0200
committerGuido Günther <agx@sigxcpu.org>2016-06-28 16:50:29 +0200
commit83dfa6743be0c117dbdf796aa08c5cc8c9b01202 (patch)
treecbe50e7e18e73145a12a94629ea0371c8aab722c
parent9c5f06d23c257b27c592aed2fe6760c8658a3822 (diff)
GitRepository: Deleting a non-existing branch should not throw an error
-rw-r--r--gbp/git/repository.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index d695cf1..171518d 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -320,6 +320,9 @@ class GitRepository(object):
@param remote: delete a remote branch
@param remote: C{bool}
"""
+ if not self.has_branch(branch):
+ return
+
args = GitArgs('-D')
args.add_true(remote, '-r')
args.add(branch)
@@ -1962,4 +1965,3 @@ class GitRepository(object):
% (remote, abspath, err[1]))
return None
#}
-