diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-27 12:57:13 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-28 13:44:06 +0100 |
commit | 02bf375f90f16f684cd9b2ac9455001007366f92 (patch) | |
tree | b8e284394aafa9b326359600966ad60adcd57646 /src/buildtool/execution_api/local | |
parent | 2b4e781e2e14653201b81b12e1b332a7462691b7 (diff) | |
download | justbuild-02bf375f90f16f684cd9b2ac9455001007366f92.tar.gz |
Avoid rehashing content when using GitRepo::ReadTreeData
Diffstat (limited to 'src/buildtool/execution_api/local')
-rw-r--r-- | src/buildtool/execution_api/local/local_cas_reader.cpp | 9 |
1 files changed, 4 insertions, 5 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()); |