diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-12 12:49:09 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-22 17:01:13 +0200 |
commit | 1d23761d8e950a5439fafe6752b8a62b699a6a7a (patch) | |
tree | 52c39d60a63e1e1f2429372b7bfb97acd06eca03 /src/buildtool/execution_api/git/git_api.hpp | |
parent | 8b86dc3a9e3d1e6825c73c41e989af801d134e12 (diff) | |
download | justbuild-1d23761d8e950a5439fafe6752b8a62b699a6a7a.tar.gz |
Use a fixed HashFunction in GitApi
Diffstat (limited to 'src/buildtool/execution_api/git/git_api.hpp')
-rw-r--r-- | src/buildtool/execution_api/git/git_api.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
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<ObjectType::File>( - HashFunction::Instance(), *entry_content); + hash_function, *entry_content); // Collect blob and upload to remote CAS if transfer // size reached. if (not UpdateContainerAndUpload<ArtifactDigest>( @@ -259,10 +262,10 @@ class GitApi final : public IExecutionApi { ArtifactDigest digest = IsTreeObject(info.type) - ? ArtifactDigest::Create<ObjectType::Tree>( - HashFunction::Instance(), *content) - : ArtifactDigest::Create<ObjectType::File>( - HashFunction::Instance(), *content); + ? ArtifactDigest::Create<ObjectType::Tree>(hash_function, + *content) + : ArtifactDigest::Create<ObjectType::File>(hash_function, + *content); // Collect blob and upload to remote CAS if transfer size reached. if (not UpdateContainerAndUpload<ArtifactDigest>( |