mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #23965 from hvnsweeting/20147-fix-gitfs-gitpython-exception
handle all exceptions gitpython can raise
This commit is contained in:
commit
314e4db512
1 changed files with 3 additions and 4 deletions
|
@ -388,13 +388,12 @@ def _get_tree_gitpython(repo, tgt_env):
|
|||
# Branch or tag not matched, check if 'tgt_env' is a commit
|
||||
if not _env_is_exposed(tgt_env):
|
||||
return None
|
||||
|
||||
try:
|
||||
commit = repo['repo'].rev_parse(tgt_env)
|
||||
except gitdb.exc.BadObject:
|
||||
pass
|
||||
else:
|
||||
return commit.tree
|
||||
return None
|
||||
except gitdb.exc.ODBError:
|
||||
return None
|
||||
|
||||
|
||||
def _get_tree_pygit2(repo, tgt_env):
|
||||
|
|
Loading…
Add table
Reference in a new issue