From 30ad034ad82b58ca878826b9260d83b321e8144a Mon Sep 17 00:00:00 2001 From: Christian Hammond Date: Sun, 22 Nov 2009 17:48:27 -0800 Subject: 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 --- rbtools/postreview.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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], -- cgit v1.2.3