aboutsummaryrefslogtreecommitdiff
path: root/src/zen/cmds/builds_cmd.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-11-18 16:34:17 +0100
committerGitHub Enterprise <[email protected]>2025-11-18 16:34:17 +0100
commit2f9b8b2000b71650ff5a2b72dae3a5312e670465 (patch)
treec58814f89b7cddc94db237f630b018e4d7982733 /src/zen/cmds/builds_cmd.cpp
parentretain xmake state between runs (#656) (diff)
downloadarchived-zen-2f9b8b2000b71650ff5a2b72dae3a5312e670465.tar.xz
archived-zen-2f9b8b2000b71650ff5a2b72dae3a5312e670465.zip
loose chunk filtering bug when using wildcards (#654)
* fix filtering of loose chunks when downloading with a filter add tests * changelog * move InlineRemoveUnusedHashes * remove extra braces
Diffstat (limited to 'src/zen/cmds/builds_cmd.cpp')
-rw-r--r--src/zen/cmds/builds_cmd.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp
index 14686a173..fcda6e809 100644
--- a/src/zen/cmds/builds_cmd.cpp
+++ b/src/zen/cmds/builds_cmd.cpp
@@ -1267,22 +1267,13 @@ namespace {
if (!DeletedPaths.empty())
{
OutRemoteContent = DeletePathsFromChunkedContent(OutRemoteContent, DeletedPaths);
-
- tsl::robin_set<IoHash, IoHash::Hasher> UsedLooseChunkHashes;
- UsedLooseChunkHashes.insert(OutRemoteContent.RawHashes.begin(), OutRemoteContent.RawHashes.end());
- for (auto It = OutLooseChunkHashes.begin(); It != OutLooseChunkHashes.end();)
- {
- if (!UsedLooseChunkHashes.contains(*It))
- {
- It = OutLooseChunkHashes.erase(It);
- }
- else
- {
- It++;
- }
- }
+ InlineRemoveUnusedHashes(OutLooseChunkHashes, OutRemoteContent.ChunkedContent.ChunkHashes);
}
}
+
+#if ZEN_BUILD_DEBUG
+ ValidateChunkedFolderContent(OutRemoteContent, OutBlockDescriptions, OutLooseChunkHashes);
+#endif // ZEN_BUILD_DEBUG
};
OutPartContents.resize(1);
@@ -1846,6 +1837,9 @@ namespace {
Options.IncludeWildcards,
Options.ExcludeWildcards,
LocalFolderContent);
+#if ZEN_BUILD_DEBUG
+ ValidateChunkedFolderContent(LocalContent, {}, LocalContent.ChunkedContent.ChunkHashes);
+#endif // ZEN_BUILD_DEBUG
}
else
{