Skip to content

Commit d98e54c

Browse files
authored
Fix bug with commit hash error.
1 parent 1760c0a commit d98e54c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

truffleHog/truffleHog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def find_entropy(printableDiff, commit_time, branch_name, prev_commit, blob, com
183183
entropicDiff['diff'] = blob.diff.decode('utf-8', errors='replace')
184184
entropicDiff['stringsFound'] = stringsFound
185185
entropicDiff['printDiff'] = printableDiff
186-
entropicDiff['commitHash'] = commitHash
186+
entropicDiff['commitHash'] = prev_commit.hexsha
187187
entropicDiff['reason'] = "High Entropy"
188188
return entropicDiff
189189

@@ -207,7 +207,7 @@ def regex_check(printableDiff, commit_time, branch_name, prev_commit, blob, comm
207207
foundRegex['stringsFound'] = found_strings
208208
foundRegex['printDiff'] = found_diff
209209
foundRegex['reason'] = key
210-
foundRegex['commitHash'] = commitHash
210+
foundRegex['commitHash'] = prev_commit.hexsha
211211
regex_matches.append(foundRegex)
212212
return regex_matches
213213

0 commit comments

Comments
 (0)