mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
ignore empty files (#965)
This commit is contained in:
1 parent
adf512e2ac
commit
e47867d802
1 file changed
+3
@@ -363,6 +363,9 @@ func (d *Detector) DetectFiles(source string) ([]report.Finding, error) {
|
||||
if fInfo.Name() == ".git" && fInfo.IsDir() {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
if fInfo.Size() == 0 {
|
||||
return nil
|
||||
}
|
||||
if fInfo.Mode().IsRegular() {
|
||||
paths <- path
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user