From 74ae139a6df49de37868f723299a600dfd5e90d8 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 29 Aug 2024 14:47:12 +0200 Subject: Replace bazel_re::Digest in BazelMsgFactory (local trees) ...with ArtifactDigest. --- test/buildtool/storage/large_object_cas.test.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'test/buildtool/storage/large_object_cas.test.cpp') 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 const& cas, } auto store_blob = [&cas](std::filesystem::path const& path, - auto is_exec) -> std::optional { + auto is_exec) -> std::optional { return cas.StoreBlob(path, is_exec); }; auto store_tree = - [&cas](std::string const& content) -> std::optional { + [&cas](std::string const& content) -> std::optional { return cas.StoreTree(content); }; auto store_symlink = - [&cas](std::string const& content) -> std::optional { + [&cas](std::string const& content) -> std::optional { 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(*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 -- cgit v1.2.3