summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-03-14 11:29:28 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2022-03-14 14:48:51 +0100
commitd3eb02b9cb29dcda33bcd2a25fc005d24079aa00 (patch)
treeaa6d5381ba619d06593d450c335e1d1618ca21e2
parent7376d096a94a17c3678a3ca48fe63f68cc66ba8f (diff)
downloadjustbuild-d3eb02b9cb29dcda33bcd2a25fc005d24079aa00.tar.gz
LocalApi: Fix missing entries in cached trees from tree map
... as wrongfully only sub-tree entries were added to locally cached trees, although they should also store entries for files and executables.
-rw-r--r--src/buildtool/execution_api/local/local_storage.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/buildtool/execution_api/local/local_storage.cpp b/src/buildtool/execution_api/local/local_storage.cpp
index b4fe1658..c007fc1d 100644
--- a/src/buildtool/execution_api/local/local_storage.cpp
+++ b/src/buildtool/execution_api/local/local_storage.cpp
@@ -104,13 +104,11 @@ auto LocalStorage::ReadObjectInfosRecursively(
return BazelMsgFactory::ReadObjectInfosFromDirectory(
*dir,
[this, &store_info, &parent, &tree](auto path, auto info) {
- return IsTreeObject(info.type)
- ? (not tree or tree->AddInfo(path, info)) and
- ReadObjectInfosRecursively(
- store_info,
- parent / path,
- info.digest)
- : store_info(parent / path, info);
+ return (not tree or tree->AddInfo(path, info)) and
+ (IsTreeObject(info.type)
+ ? ReadObjectInfosRecursively(
+ store_info, parent / path, info.digest)
+ : store_info(parent / path, info));
}) and
(not tree_map_ or tree_map_->AddTree(digest, std::move(*tree)));
}