summaryrefslogtreecommitdiff
path: root/test/buildtool/storage
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-08-29 14:47:12 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-08-30 17:17:09 +0200
commit74ae139a6df49de37868f723299a600dfd5e90d8 (patch)
tree9a718332d26f3c5280e8c86ebceb4a1b89613e35 /test/buildtool/storage
parent5ecbcbbcf71ca9fafaddf9a2353fe31a75fb33e4 (diff)
downloadjustbuild-74ae139a6df49de37868f723299a600dfd5e90d8.tar.gz
Replace bazel_re::Digest in BazelMsgFactory (local trees)
...with ArtifactDigest.
Diffstat (limited to 'test/buildtool/storage')
-rw-r--r--test/buildtool/storage/large_object_cas.test.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/test/buildtool/storage/large_object_cas.test.cpp b/test/buildtool/storage/large_object_cas.test.cpp
index 8199ee85..f0644694 100644
--- a/test/buildtool/storage/large_object_cas.test.cpp
+++ b/test/buildtool/storage/large_object_cas.test.cpp
@@ -708,28 +708,23 @@ auto Tree::StoreRaw(LocalCAS<kDefaultDoGlobalUplink> const& cas,
}
auto store_blob = [&cas](std::filesystem::path const& path,
- auto is_exec) -> std::optional<bazel_re::Digest> {
+ auto is_exec) -> std::optional<ArtifactDigest> {
return cas.StoreBlob</*kOwner=*/true>(path, is_exec);
};
auto store_tree =
- [&cas](std::string const& content) -> std::optional<bazel_re::Digest> {
+ [&cas](std::string const& content) -> std::optional<ArtifactDigest> {
return cas.StoreTree(content);
};
auto store_symlink =
- [&cas](std::string const& content) -> std::optional<bazel_re::Digest> {
+ [&cas](std::string const& content) -> std::optional<ArtifactDigest> {
return cas.StoreBlob(content);
};
- auto bazel_digest =
- Compatibility::IsCompatible()
- ? BazelMsgFactory::CreateDirectoryDigestFromLocalTree(
- directory, store_blob, store_tree, store_symlink)
- : BazelMsgFactory::CreateGitTreeDigestFromLocalTree(
- directory, store_blob, store_tree, store_symlink);
- if (bazel_digest.has_value()) {
- return static_cast<ArtifactDigest>(*bazel_digest);
- }
- return std::nullopt;
+ return Compatibility::IsCompatible()
+ ? BazelMsgFactory::CreateDirectoryDigestFromLocalTree(
+ directory, store_blob, store_tree, store_symlink)
+ : BazelMsgFactory::CreateGitTreeDigestFromLocalTree(
+ directory, store_blob, store_tree, store_symlink);
}
} // namespace LargeTestUtils