From a915fc0836c83c62327824126e85059bb89c1198 Mon Sep 17 00:00:00 2001
From: Yorhel <git@yorhel.nl>
Date: Mon, 19 Jul 2021 16:58:34 +0200
Subject: [PATCH] Fix counting of sizes for new directories

---
 src/scan.zig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/scan.zig b/src/scan.zig
index 7ec36b1..dfa4e8c 100644
--- a/src/scan.zig
+++ b/src/scan.zig
@@ -204,7 +204,7 @@ const ScanDir = struct {
         // entire subtree, which, in turn, would break all shared hardlink
         // sizes. The current approach may result in incorrect sizes after
         // refresh, but I expect the difference to be fairly minor.
-        if (e.etype != .dir and (e.blocks != stat.blocks or e.size != stat.size)) {
+        if (!(e.etype == .dir and e.counted) and (e.blocks != stat.blocks or e.size != stat.size)) {
             e.delStats(parents);
             e.blocks = stat.blocks;
             e.size = stat.size;
-- 
GitLab