diff options
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r-- | gbp/git/repository.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index aeaa5a36..a7524a4d 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -402,12 +402,12 @@ class GitRepository(object): @return: C{True} if the repository has this branch, C{False} otherwise @rtype: C{bool} """ - if remote: - ref = 'refs/remotes/%s' % branch - else: - ref = 'refs/heads/%s' % branch + args = GitArgs('--verify') + + branch_pattern = 'refs/remotes/%s' if remote else 'refs/heads/%s' + args.add(branch_pattern % branch) try: - self._git_command('show-ref', [ref]) + self._git_command('show-ref', args.args) except GitRepositoryError: return False return True |