mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-05 06:48:48 +00:00
Wrap inventreeBranch check in try/except (#5842)
- Same as in master branch
This commit is contained in:
parent
d2a313bda9
commit
5d55555394
@ -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