Skip to content

Commit 22ebf02

Browse files
fix: diff only if not already searched (#420)
1 parent 085d9ea commit 22ebf02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tartufo/scanner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,12 +901,12 @@ def chunks(self) -> Generator[types.Chunk, None, None]:
901901
"Skipping commit %s because it has no parents", curr_commit.hex
902902
)
903903
continue
904-
diff: pygit2.Diff = self._repo.diff(prev_commit, curr_commit)
905904
diff_hash = hashlib.md5(
906905
(str(prev_commit) + str(curr_commit)).encode("utf-8")
907906
).digest()
908907
if diff_hash in already_searched:
909908
continue
909+
diff: pygit2.Diff = self._repo.diff(prev_commit, curr_commit)
910910
already_searched.add(diff_hash)
911911
diff.find_similar()
912912
for blob, file_path in self._iter_diff_index(diff):

0 commit comments

Comments
 (0)