Skip to content

Commit

Permalink
Actually skip excluded paths
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
  • Loading branch information
anmazzotti committed Mar 1, 2024
1 parent d667877 commit 5769aeb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/utils/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ func DirSize(fs v1.FS, path string, excludes ...string) (int64, error) {
if err != nil {
return err
}
for _, exclude := range excludes {
if strings.HasPrefix(loopPath, exclude) {
return nil
if info.IsDir() {
for _, exclude := range excludes {
if strings.HasPrefix(loopPath, exclude) {
return filepath.SkipDir
}
}
}
if !info.IsDir() {
Expand Down

0 comments on commit 5769aeb

Please sign in to comment.