From 1d23761d8e950a5439fafe6752b8a62b699a6a7a Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 12 Jul 2024 12:49:09 +0200 Subject: Use a fixed HashFunction in GitApi --- src/buildtool/execution_api/git/git_api.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/buildtool/execution_api/git/git_api.hpp') diff --git a/src/buildtool/execution_api/git/git_api.hpp b/src/buildtool/execution_api/git/git_api.hpp index b6a30a9b..470dca41 100644 --- a/src/buildtool/execution_api/git/git_api.hpp +++ b/src/buildtool/execution_api/git/git_api.hpp @@ -195,6 +195,9 @@ class GitApi final : public IExecutionApi { return false; } + // GitApi works in the native mode only. + HashFunction const hash_function{HashFunction::JustHash::Native}; + // Collect blobs of missing artifacts from local CAS. Trees are // processed recursively before any blob is uploaded. ArtifactBlobContainer container{}; @@ -228,7 +231,7 @@ class GitApi final : public IExecutionApi { return false; } auto digest = ArtifactDigest::Create( - HashFunction::Instance(), *entry_content); + hash_function, *entry_content); // Collect blob and upload to remote CAS if transfer // size reached. if (not UpdateContainerAndUpload( @@ -259,10 +262,10 @@ class GitApi final : public IExecutionApi { ArtifactDigest digest = IsTreeObject(info.type) - ? ArtifactDigest::Create( - HashFunction::Instance(), *content) - : ArtifactDigest::Create( - HashFunction::Instance(), *content); + ? ArtifactDigest::Create(hash_function, + *content) + : ArtifactDigest::Create(hash_function, + *content); // Collect blob and upload to remote CAS if transfer size reached. if (not UpdateContainerAndUpload( -- cgit v1.2.3