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

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: convert HEAD to empty string 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
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/tool/commands/rebaseline.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1a5c7ab5b4663732bd3b1a62d22fe72efcf419b7 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())
+ ref = self._run_git(['rev-parse', '--symbolic-full-name', 'HEAD']).strip()
+ # Return an empty string if HEAD is detached.
+ return self._branch_from_ref('' if ref == 'HEAD' else 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698