summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'project.py')
-rw-r--r--project.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/project.py b/project.py
index 84a5cdf6..4c699d4b 100644
--- a/project.py
+++ b/project.py
@@ -3835,7 +3835,11 @@ class Project:
3835 def GetHead(self): 3835 def GetHead(self):
3836 """Return the ref that HEAD points to.""" 3836 """Return the ref that HEAD points to."""
3837 try: 3837 try:
3838 return self.rev_parse("--symbolic-full-name", HEAD) 3838 symbolic_head = self.rev_parse("--symbolic-full-name", HEAD)
3839 if symbolic_head == HEAD:
3840 # Detached HEAD. Return the commit SHA instead.
3841 return self.rev_parse(HEAD)
3842 return symbolic_head
3839 except GitError as e: 3843 except GitError as e:
3840 path = self.GetDotgitPath(subpath=HEAD) 3844 path = self.GetDotgitPath(subpath=HEAD)
3841 raise NoManifestException(path, str(e)) 3845 raise NoManifestException(path, str(e))