Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions osv/impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,16 @@ def _get_equivalent_commit(self,
# Ignore commits without parents and merge commits with multiple parents.
if not commit.parents or len(commit.parents) > 1:
continue

patch_id = repo.cache.get(commit.id)
if not patch_id:
#Handle repositories that do not support cache
if hasattr(repo, 'cache'):
patch_id = repo.cache.get(commit.id)
if not patch_id:
diff = repo.diff(commit.parents[0], commit)
patch_id = diff.patchid
repo.cache[commit.id] = patch_id
else:
diff = repo.diff(commit.parents[0], commit)
patch_id = diff.patchid
repo.cache[commit.id] = patch_id

if patch_id == target_patch_id:
return str(commit.id)
Expand Down
Loading