diff options
| author | Stefan Boberg <[email protected]> | 2025-05-07 07:52:32 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-05-07 08:52:32 +0200 |
| commit | 7369ad887cf6055192c9234d8eec1550dfabd883 (patch) | |
| tree | 9d7530225b18ef08889cb0886bab36b920ddf893 /src | |
| parent | optimize cache bucket state writing (#382) (diff) | |
| download | zen-7369ad887cf6055192c9234d8eec1550dfabd883.tar.xz zen-7369ad887cf6055192c9234d8eec1550dfabd883.zip | |
added logic to handle empty directories correctly (#383)
* added logic to handle empty directories correctly
Diffstat (limited to 'src')
| -rw-r--r-- | src/zen/cmds/wipe_cmd.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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(); |