mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Handle case where git head is detached (#5161)
- branch information does not exist in this case - Fixes https://github.com/inventree/InvenTree/issues/5133
This commit is contained in:
parent
637a0ca7a5
commit
d52a839cf2
@ -162,8 +162,11 @@ def inventreeBranch():
|
||||
if main_commit is None:
|
||||
return None
|
||||
|
||||
branch = main_repo.refs.follow(b'HEAD')[0][1].decode()
|
||||
return branch.removeprefix('refs/heads/')
|
||||
try:
|
||||
branch = main_repo.refs.follow(b'HEAD')[0][1].decode()
|
||||
return branch.removeprefix('refs/heads/')
|
||||
except IndexError:
|
||||
return None # pragma: no cover
|
||||
|
||||
|
||||
def inventreeTarget():
|
||||
|
Loading…
Reference in New Issue
Block a user