summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZhang Qiang <qiang.z.zhang@intel.com>2012-08-01 14:14:20 +0800
committerGuido Günther <agx@sigxcpu.org>2012-08-22 10:16:42 +0200
commit0af1e729df48d691018ceaec01ef9672d0554471 (patch)
tree9c080b979e5e3bedc7f6c9735713ae2a35435ee7
parentf4162be94982b88224d6c01e34d4f8002634a8b4 (diff)
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 <qiang.z.zhang@intel.com>
-rw-r--r--gbp/git/repository.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 0da40604..f3cde12d 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