mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 21:44:23 +01:00
Honour file whitelist for AuditUncommitted function
This commit is contained in:
1 parent
725da55905
commit
d9a060a12d
1 file changed
+4
@@ -146,6 +146,9 @@ func (repo *Repo) AuditUncommitted() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if fileMatched(filename, repo.config.Whitelist.File) {
|
||||||
|
log.Debugf("whitelisted file found, skipping audit of file: %s", filename)
|
||||||
|
} else {
|
||||||
dmp := diffmatchpatch.New()
|
dmp := diffmatchpatch.New()
|
||||||
diffs := dmp.DiffMain(prevFileContents, currFileContents, false)
|
diffs := dmp.DiffMain(prevFileContents, currFileContents, false)
|
||||||
var diffContents string
|
var diffContents string
|
||||||
@@ -160,6 +163,7 @@ func (repo *Repo) AuditUncommitted() error {
|
|||||||
InspectString(diffContents, c, repo, filename)
|
InspectString(diffContents, c, repo, filename)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in new issue
Block a user