From 0af1e729df48d691018ceaec01ef9672d0554471 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Wed, 1 Aug 2012 14:14:20 +0800 Subject: GitRepository/branch_contains: remove prefix '*' in branch name The git output always prefixes the current branch name with '*'. Without this fix branch_contains() always fails for the currently active branch. Signed-off-by: Zhang Qiang --- gbp/git/repository.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gbp') diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 0da4060..f3cde12 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -445,6 +445,8 @@ class GitRepository(object): out, ret = self._git_getoutput('branch', args.args) for line in out: + # remove prefix '*' for current branch before comparing + line = line.replace('*', '') if line.strip() == branch: return True return False -- cgit v1.2.3