Skip to content

Commit 3284a24

Browse files
author
Quinn Stearns
committed
Add back repeated diff scanning prevention
This check was removed while resolving merge conflicts in f2f593a which appears to have been accidental.
1 parent 38b7e16 commit 3284a24

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

truffleHog/truffleHog.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,14 @@ def find_strings(git_url, since_commit=None, max_depth=1000000, printJson=False,
267267
continue
268268
else:
269269
diff = prev_commit.diff(curr_commit, create_patch=True)
270+
271+
# avoid searching the same diffs
272+
hashes = str(prev_commit) + str(curr_commit)
273+
if hashes in already_searched:
274+
prev_commit = curr_commit
275+
continue
276+
already_searched.add(hashes)
277+
270278
foundIssues = diff_worker(diff, curr_commit, prev_commit, branch_name, commitHash, custom_regexes, do_entropy, do_regex, printJson)
271279
output = handle_results(output, output_dir, foundIssues)
272280
prev_commit = curr_commit

0 commit comments

Comments
 (0)