2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +00:00

Wrap inventreeBranch check in try/except (#5842)

- Same as in master branch
This commit is contained in:
Oliver
2023-11-03 11:35:21 +11:00
committed by GitHub
parent d2a313bda9
commit 5d55555394

View File

@ -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():