diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-02 10:50:48 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-09 13:07:13 +0200 |
commit | 7eafe5779703275d455558120efc754c2dcc3c01 (patch) | |
tree | e31168069ef2460f187652157fe3c03be698d9a8 /src/buildtool/execution_api/git | |
parent | 50bcabb0717dae7c8411db59115c41b7cc636cb3 (diff) | |
download | justbuild-7eafe5779703275d455558120efc754c2dcc3c01.tar.gz |
Replace ArtifactDigest::Create
...with ArtifactDigestFactory::HashDataAs
Diffstat (limited to 'src/buildtool/execution_api/git')
-rw-r--r-- | src/buildtool/execution_api/git/TARGETS | 1 | ||||
-rw-r--r-- | src/buildtool/execution_api/git/git_api.hpp | 14 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/buildtool/execution_api/git/TARGETS b/src/buildtool/execution_api/git/TARGETS index 34b2e4dd..68f2b019 100644 --- a/src/buildtool/execution_api/git/TARGETS +++ b/src/buildtool/execution_api/git/TARGETS @@ -5,6 +5,7 @@ , "deps": [ ["@", "gsl", "", "gsl"] , ["src/buildtool/common", "common"] + , ["src/buildtool/common", "artifact_digest_factory"] , ["src/buildtool/common", "config"] , ["src/buildtool/execution_api/bazel_msg", "bazel_msg_factory"] , ["src/buildtool/execution_api/common", "common"] diff --git a/src/buildtool/execution_api/git/git_api.hpp b/src/buildtool/execution_api/git/git_api.hpp index 43afc14a..20814420 100644 --- a/src/buildtool/execution_api/git/git_api.hpp +++ b/src/buildtool/execution_api/git/git_api.hpp @@ -24,6 +24,7 @@ #include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/common/artifact_digest_factory.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp" @@ -231,8 +232,9 @@ class GitApi final : public IExecutionApi { if (not entry_content) { return false; } - auto digest = ArtifactDigest::Create<ObjectType::File>( - hash_function, *entry_content); + auto digest = + ArtifactDigestFactory::HashDataAs<ObjectType::File>( + hash_function, *entry_content); // Collect blob and upload to remote CAS if transfer // size reached. if (not UpdateContainerAndUpload<ArtifactDigest>( @@ -263,10 +265,10 @@ class GitApi final : public IExecutionApi { ArtifactDigest digest = IsTreeObject(info.type) - ? ArtifactDigest::Create<ObjectType::Tree>(hash_function, - *content) - : ArtifactDigest::Create<ObjectType::File>(hash_function, - *content); + ? ArtifactDigestFactory::HashDataAs<ObjectType::Tree>( + hash_function, *content) + : ArtifactDigestFactory::HashDataAs<ObjectType::File>( + hash_function, *content); // Collect blob and upload to remote CAS if transfer size reached. if (not UpdateContainerAndUpload<ArtifactDigest>( |