From c754c6b916721f560d1c385bd30823674c4241ee Mon Sep 17 00:00:00 2001 From: Christian Hammond Date: Fri, 29 Jan 2010 21:24:04 -0800 Subject: Fix a bug with parsing merge branch names. We were using lstrip to remove the prefix 'refs/heads/', but that strips all characters in the string, not the string itself. We now properly strip this prefix. Patch by Dan Savilonis Reviewed at http://reviews.reviewboard.org/r/1360/ --- rbtools/postreview.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rbtools/postreview.py b/rbtools/postreview.py index a313a79..c8508d4 100755 --- a/rbtools/postreview.py +++ b/rbtools/postreview.py @@ -2036,7 +2036,11 @@ class GitClient(SCMClient): remote = execute(['git', 'config', '--get', 'branch.%s.remote' % short_head], ignore_errors=True).strip() - merge = merge.lstrip('refs/heads/') + + HEADS_PREFIX = 'refs/heads/' + + if merge.startswith(HEADS_PREFIX): + merge = merge[len(HEADS_PREFIX):] self.upstream_branch = '' -- cgit v1.2.3