Skip to content

Commit

Permalink
ignore empty files (gitleaks#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
zricethezav authored Aug 26, 2022
1 parent adf512e commit e47867d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions detect/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e47867d

Please sign in to comment.