mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-04 01:15:20 +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:
1 parent
637a0ca7a5
commit
d52a839cf2
1 file changed
+3
@@ -162,8 +162,11 @@ def inventreeBranch():
|
||||
if main_commit is None:
|
||||
return None
|
||||
|
||||
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():
|
||||
|
||||
Reference in new issue
Block a user