mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +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() {
|
if fInfo.Name() == ".git" && fInfo.IsDir() {
|
||||||
return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
}
|
}
|
||||||
|
if fInfo.Size() == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if fInfo.Mode().IsRegular() {
|
if fInfo.Mode().IsRegular() {
|
||||||
paths <- path
|
paths <- path
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user