aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gbp/git/repository.py3
-rw-r--r--tests/test_GitRepository.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 640cc88a..fe405884 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -381,8 +381,9 @@ class GitRepository(object):
@param remote: whether to check remote instead of local branches
@type remote: C{bool}
"""
- args = GitArgs('--contains')
+ args = GitArgs()
args.add_true(remote, '-r')
+ args.add('--contains')
args.add(commit)
out, ret = self.__git_getoutput('branch', args.args)
diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py
index 50b733db..7eaae1e3 100644
--- a/tests/test_GitRepository.py
+++ b/tests/test_GitRepository.py
@@ -117,6 +117,8 @@ def test_create_branch():
>>> repo.create_branch("foo")
>>> repo.branch_contains("foo", 'HEAD')
True
+ >>> repo.branch_contains("doesnotexist", 'HEAD', remote=True)
+ False
"""
def test_delete_branch():