mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
duplicate leak logic includes the line in hash (#345)
This commit is contained in:
1 parent
c4b07f5113
commit
94cae90d1e
9 files changed
+70
-3
No files matched your search
+1
-2
@@ -98,7 +98,6 @@ func shannonEntropy(data string) (entropy float64) {
|
||||
return entropy
|
||||
}
|
||||
|
||||
|
||||
// Checks if the given rule has a regex
|
||||
func ruleContainRegex(rule config.Rule) bool {
|
||||
if rule.Regex == nil {
|
||||
@@ -189,7 +188,7 @@ func InspectFile(content string, fullpath string, c *object.Commit, repo *Repo)
|
||||
if isFileNameWhiteListed(filename, rule.Whitelist) || isFilePathWhiteListed(path, rule.Whitelist) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
// If it has fileNameRegex and it doesnt match we continue to next rule
|
||||
if ruleContainFileNameRegex(rule) && !fileMatched(filename, rule.FileNameRegex) {
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user