diff options
Diffstat (limited to 'src/buildtool/execution_api')
4 files changed, 9 insertions, 14 deletions
diff --git a/src/buildtool/execution_api/local/local_cas_reader.cpp b/src/buildtool/execution_api/local/local_cas_reader.cpp index 58af1cbd..9af9650a 100644 --- a/src/buildtool/execution_api/local/local_cas_reader.cpp +++ b/src/buildtool/execution_api/local/local_cas_reader.cpp @@ -120,11 +120,10 @@ auto LocalCasReader::ReadGitTree(ArtifactDigest const& digest) const noexcept // Git-SHA1 hashing is used for reading from git. HashFunction const hash_function{HashFunction::Type::GitSHA1}; - return GitRepo::ReadTreeData( - *content, - hash_function.HashTreeData(*content).Bytes(), - check_symlinks, - /*is_hex_id=*/false); + return GitRepo::ReadTreeData(*content, + digest.hash(), + check_symlinks, + /*is_hex_id=*/true); } } Logger::Log(LogLevel::Debug, "Tree {} not found in CAS", digest.hash()); diff --git a/src/buildtool/execution_api/remote/bazel/bazel_network_reader.cpp b/src/buildtool/execution_api/remote/bazel/bazel_network_reader.cpp index 4dda2425..892cf3d9 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_network_reader.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_network_reader.cpp @@ -113,9 +113,9 @@ auto BazelNetworkReader::ReadGitTree(ArtifactDigest const& digest) }; return GitRepo::ReadTreeData(*content, - hash_function_.HashTreeData(*content).Bytes(), + digest.hash(), check_symlinks, - /*is_hex_id=*/false); + /*is_hex_id=*/true); } auto BazelNetworkReader::DumpRawTree(Artifact::ObjectInfo const& info, diff --git a/src/buildtool/execution_api/utils/TARGETS b/src/buildtool/execution_api/utils/TARGETS index 35601176..f9aafff2 100644 --- a/src/buildtool/execution_api/utils/TARGETS +++ b/src/buildtool/execution_api/utils/TARGETS @@ -11,7 +11,6 @@ [ ["@", "gsl", "", "gsl"] , ["src/buildtool/common", "bazel_types"] , ["src/buildtool/common", "protocol_traits"] - , ["src/buildtool/crypto", "hash_function"] , ["src/buildtool/execution_api/bazel_msg", "bazel_msg_factory"] , ["src/buildtool/execution_api/common", "common"] , ["src/buildtool/file_system", "git_repo"] diff --git a/src/buildtool/execution_api/utils/subobject.cpp b/src/buildtool/execution_api/utils/subobject.cpp index f1b1b459..466c3b73 100644 --- a/src/buildtool/execution_api/utils/subobject.cpp +++ b/src/buildtool/execution_api/utils/subobject.cpp @@ -20,9 +20,9 @@ #include <utility> #include "gsl/gsl" +#include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/bazel_types.hpp" #include "src/buildtool/common/protocol_traits.hpp" -#include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" #include "src/buildtool/execution_api/common/tree_reader_utils.hpp" @@ -87,14 +87,11 @@ auto RetrieveSubPathId(Artifact::ObjectInfo object_info, object_info = *new_object_info; } else { - auto const hash = HashFunction{HashFunction::Type::GitSHA1} - .HashTreeData(*data) - .Bytes(); auto entries = GitRepo::ReadTreeData( *data, - hash, + object_info.digest.hash(), [](auto const& /*unused*/) { return true; }, - /*is_hex_id=*/false); + /*is_hex_id=*/true); if (not entries) { Logger::Log(LogLevel::Warning, "Failed to parse tree {} at path '{}'", |