Get git commit id also in detached head mode.
This commit is contained in:
parent
589c209c79
commit
d53017eea8
@ -40,7 +40,7 @@ def get_git_commit_id():
|
||||
"""
|
||||
try:
|
||||
git_head = open('.git/HEAD', 'r').read().rstrip()
|
||||
if True: #starts with 'ref: '
|
||||
if git_head[:5] == 'ref: ':
|
||||
git_commit_id = open('.git/%s' % git_head[5:], 'r').read().rstrip()
|
||||
else:
|
||||
git_commit_id = git_head
|
||||
|
Loading…
Reference in New Issue
Block a user