Handle detached HEAD when reporting what the active git branch is.

master
Pacman Ghost 4 years ago
parent c56b362113
commit 48c69927f6
  1. 2
      freeze.py

@ -47,6 +47,8 @@ def get_git_info():
if len(lines) != 1:
raise RuntimeError( "Can't parse git branch status." )
branch_name = lines[0][2:]
if branch_name.startswith( "(HEAD detached at" ) and branch_name.endswith( ")" ):
branch_name = branch_name[18:-1]
return { "last_commit_id": last_commit_id, "branch_name": branch_name }

Loading…
Cancel
Save