From dd12fcb5eea5970ac8ef6acd7a200c1e92ce81ea Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 29 Aug 2024 09:18:09 +0200 Subject: Replace bazel_re::Digest in GitRepo::SymlinksCheckFunc callback ...with ArtifactDigest. --- test/buildtool/file_system/TARGETS | 1 - test/buildtool/file_system/git_tree.test.cpp | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'test/buildtool/file_system') diff --git a/test/buildtool/file_system/TARGETS b/test/buildtool/file_system/TARGETS index 8f474e67..baa886f0 100644 --- a/test/buildtool/file_system/TARGETS +++ b/test/buildtool/file_system/TARGETS @@ -44,7 +44,6 @@ , ["@", "src", "src/buildtool/file_system", "git_repo"] , ["@", "src", "src/buildtool/file_system", "git_tree"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] - , ["@", "src", "src/buildtool/common", "bazel_types"] , ["@", "src", "src/buildtool/common", "common"] , ["@", "src", "src/utils/cpp", "hex_string"] , ["utils", "shell_quoting"] diff --git a/test/buildtool/file_system/git_tree.test.cpp b/test/buildtool/file_system/git_tree.test.cpp index f2cff0ba..c8a0b14d 100644 --- a/test/buildtool/file_system/git_tree.test.cpp +++ b/test/buildtool/file_system/git_tree.test.cpp @@ -27,7 +27,6 @@ #include "catch2/catch_test_macros.hpp" #include "fmt/core.h" #include "src/buildtool/common/artifact_digest.hpp" -#include "src/buildtool/common/bazel_types.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/git_cas.hpp" #include "src/buildtool/file_system/git_repo.hpp" @@ -106,11 +105,10 @@ class SymlinksChecker final { : cas_{*cas} {} [[nodiscard]] auto operator()( - std::vector const& ids) const noexcept -> bool { + std::vector const& ids) const noexcept -> bool { return std::all_of( - ids.begin(), ids.end(), [&cas = cas_](bazel_re::Digest const& id) { - auto content = cas.ReadObject(ArtifactDigest(id).hash(), - /*is_hex_id=*/true); + ids.begin(), ids.end(), [&cas = cas_](ArtifactDigest const& id) { + auto content = cas.ReadObject(id.hash(), /*is_hex_id=*/true); return content.has_value() and PathIsNonUpwards(*content); }); }; -- cgit v1.2.3