Skip to content

Commit

Permalink
Fix exception in git range analysis. (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverchang authored Nov 26, 2021
1 parent b8db8c8 commit a2bc342
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/osv/impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,12 @@ def _get_equivalent_commit(self,
if not target_commit:
return None

target = repo.revparse_single(target_commit)
try:
target = repo.revparse_single(target_commit)
except KeyError:
# Invalid commit.
return None

target_patch_id = repo.diff(target.parents[0], target).patchid

search = repo.revparse_single(to_search)
Expand Down

0 comments on commit a2bc342

Please sign in to comment.