Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2587)

Unified Diff: Tools/Scripts/webkitpy/common/checkout/scm/git.py

Issue 1235353002: Fix resolution of local branch name in scm and rebaseline tools. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: also check for detached HEAD in rebaseline-o-matic Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/Scripts/webkitpy/common/checkout/scm/git.py
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/git.py b/Tools/Scripts/webkitpy/common/checkout/scm/git.py
index 9a73ce961aef45e36770c1f1e125ce49c5076e0e..2423c565708e73920e46d685a87d696d8bdeb6a6 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/git.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/git.py
@@ -134,7 +134,9 @@ class Git(SCM):
return ref.replace('refs/heads/', '')
def current_branch(self):
- return self._branch_from_ref(self._run_git(['symbolic-ref', '-q', 'HEAD']).strip())
+ # Returns an empty string if HEAD is detached.
Xianzhu 2015/07/16 22:01:19 The following code will return 'HEAD' when HEAD is
joelo 2015/07/16 23:00:11 Whoops, you're right. I meant to check for that an
+ ref = self._run_git(['rev-parse', '--symbolic-full-name', 'HEAD']).strip()
+ return self._branch_from_ref(ref)
def _upstream_branch(self):
current_branch = self.current_branch()
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/tool/commands/rebaseline.py » ('j') | Tools/Scripts/webkitpy/tool/commands/rebaseline.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698