diff options
author | Zhang Qiang <qiang.z.zhang@intel.com> | 2012-08-01 14:14:20 +0800 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-08-22 10:16:42 +0200 |
commit | 0af1e729df48d691018ceaec01ef9672d0554471 (patch) | |
tree | 9c080b979e5e3bedc7f6c9735713ae2a35435ee7 /gbp | |
parent | f4162be94982b88224d6c01e34d4f8002634a8b4 (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>
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/git/repository.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 |