diff options
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zen/cmds/wipe_cmd.cpp | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b7f6b2ef6..5a96958de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Bugfix: Add explicit lambda capture in CasContainer::IterateChunks to avoid accessing state data references - Bugfix: Validate compact binary objects stored in cache before attempting to parse them to avoid crash when data is corrupt - Bugfix: Don't report redundant error if disk is full when writing GC state or GC log +- Bugfix: Properly handle empty directories when using `zen wipe` command - Improvement: If garbage collection fails due to out of disk or out of memory we issue a warning instead of reporting an error to Sentry - Improvement: Improved cache bucket state index write time with ~15% and cache bucket side-car write time with ~20% diff --git a/src/zen/cmds/wipe_cmd.cpp b/src/zen/cmds/wipe_cmd.cpp index 9bf0c6f9e..269f95417 100644 --- a/src/zen/cmds/wipe_cmd.cpp +++ b/src/zen/cmds/wipe_cmd.cpp @@ -283,7 +283,18 @@ namespace { { DiscoveredItemCount++; } - if (!Content.FileNames.empty()) + if (Content.FileNames.empty()) + { + const std::filesystem::path ParentPath = Path / RelativeRoot; + bool KeepDirectory = RelativeRoot.empty(); + + bool Added = AddFoundDirectoryFunc(ParentPath, KeepDirectory); + if (Added) + { + ZEN_CONSOLE_VERBOSE("{} directory {}", KeepDirectory ? "Keeping" : "Removing", ParentPath); + } + } + else { DiscoveredItemCount += Content.FileNames.size(); |