summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2009-11-22 17:48:27 -0800
committerChristian Hammond <chipx86@chipx86.com>2009-11-22 17:48:27 -0800
commit30ad034ad82b58ca878826b9260d83b321e8144a (patch)
tree4c3cedb71909752feb4fdc7138fe11db821d7fe1
parentb8e86ebfcf58cbf998ac981326c65f6ffb500a00 (diff)
Fix a breakage in git-svn.
We need GitClient.head_ref to be defined for diffing, but this was only defined in the pure Git case. We now set this before determining the mode for GitClient. Fixes bug #1400
-rwxr-xr-xrbtools/postreview.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rbtools/postreview.py b/rbtools/postreview.py
index 5045df8..3bbd8ca 100755
--- a/rbtools/postreview.py
+++ b/rbtools/postreview.py
@@ -1923,6 +1923,8 @@ class GitClient(SCMClient):
# of a work-tree would result in broken diffs on the server
os.chdir(os.path.dirname(os.path.abspath(git_dir)))
+ self.head_ref = execute(['git', 'symbolic-ref', '-q', 'HEAD']).strip()
+
# We know we have something we can work with. Let's find out
# what it is. We'll try SVN first.
data = execute(["git", "svn", "info"], ignore_errors=True)
@@ -1969,7 +1971,6 @@ class GitClient(SCMClient):
# Nope, it's git then.
# Check for a tracking branch and determine merge-base
- self.head_ref = execute(['git', 'symbolic-ref', '-q', 'HEAD']).strip()
short_head = self.head_ref.split('/')[-1]
merge = execute(['git', 'config', '--get',
'branch.%s.merge' % short_head],