]> Sergey Matveev's repositories - glocate.git/commitdiff
Nullify directory sizes before DirSizer
authorSergey Matveev <stargrave@stargrave.org>
Sun, 4 Sep 2022 10:51:33 +0000 (13:51 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 4 Sep 2022 10:51:33 +0000 (13:51 +0300)
diff.go

diff --git a/diff.go b/diff.go
index be79911b777e14b1857fe35a74639400adbbdb1a91a80884fcf0640ce71a5d78..181f5c3ee94b6acbe65d9b29786325b881e0d221b7af78d7481638beacbcf832 100644 (file)
--- a/diff.go
+++ b/diff.go
@@ -223,6 +223,9 @@ func updateWithDiff(dbPath, strip string) *os.File {
                        ent.size = mods[0].size
                        mods = mods[1:]
                }
+               if ent.IsDir() {
+                       ent.size = 0
+               }
                entsDirSizer <- ent
        }
        for len(adds) > 0 {