mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1908311 - Fix GitRepository.branch with older versions of git. r=sheehan
Differential Revision: https://phabricator.services.mozilla.com/D216786
This commit is contained in:
parent
d7c6c15874
commit
c7188972f0
@ -806,7 +806,11 @@ class GitRepository(Repository):
|
||||
|
||||
@property
|
||||
def branch(self):
|
||||
return self._run("branch", "--show-current").strip() or None
|
||||
# This mimics `git branch --show-current` for older versions of git.
|
||||
branch = self._run("symbolic-ref", "-q", "HEAD").strip()
|
||||
if not branch.startswith("refs/heads/"):
|
||||
return None
|
||||
return branch[len("refs/heads/") :]
|
||||
|
||||
@property
|
||||
def has_git_cinnabar(self):
|
||||
|
Loading…
Reference in New Issue
Block a user