summaryrefslogtreecommitdiff
path: root/rbtools/postreview.py
diff options
context:
space:
mode:
Diffstat (limited to 'rbtools/postreview.py')
-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],