Merge pull request #23965 from hvnsweeting/20147-fix-gitfs-gitpython-exception

handle all exceptions gitpython can raise
This commit is contained in:
Michael Steed 2015-05-20 09:08:03 -06:00
commit 314e4db512

View file

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