From 02bf375f90f16f684cd9b2ac9455001007366f92 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 27 Feb 2025 12:57:13 +0100 Subject: Avoid rehashing content when using GitRepo::ReadTreeData --- src/buildtool/execution_api/local/local_cas_reader.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/buildtool/execution_api/local/local_cas_reader.cpp') 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()); -- cgit v1.2.3