summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2010-01-29 21:24:04 -0800
committerChristian Hammond <chipx86@chipx86.com>2010-01-29 21:24:04 -0800
commitc754c6b916721f560d1c385bd30823674c4241ee (patch)
treef0403715a0af0b8e2c0d32c0e87394eac1b53cfa
parent7c2e3186477c529008fc69921e39509c1c93ae06 (diff)
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/
-rwxr-xr-xrbtools/postreview.py6
1 files changed, 5 insertions, 1 deletions
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 = ''