| 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()
|
|
|