mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 21:16:46 +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:
|
if main_commit is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
branch = main_repo.refs.follow(b'HEAD')[0][1].decode()
|
try:
|
||||||
return branch.removeprefix('refs/heads/')
|
branch = main_repo.refs.follow(b'HEAD')[0][1].decode()
|
||||||
|
return branch.removeprefix('refs/heads/')
|
||||||
|
except IndexError:
|
||||||
|
return None # pragma: no cover
|
||||||
|
|
||||||
|
|
||||||
def inventreeTarget():
|
def inventreeTarget():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user