From 7eafe5779703275d455558120efc754c2dcc3c01 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Mon, 2 Sep 2024 10:50:48 +0200 Subject: Replace ArtifactDigest::Create ...with ArtifactDigestFactory::HashDataAs --- src/buildtool/execution_api/git/TARGETS | 1 + src/buildtool/execution_api/git/git_api.hpp | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/buildtool/execution_api/git') 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( - hash_function, *entry_content); + auto digest = + ArtifactDigestFactory::HashDataAs( + hash_function, *entry_content); // Collect blob and upload to remote CAS if transfer // size reached. if (not UpdateContainerAndUpload( @@ -263,10 +265,10 @@ class GitApi final : public IExecutionApi { ArtifactDigest digest = IsTreeObject(info.type) - ? ArtifactDigest::Create(hash_function, - *content) - : ArtifactDigest::Create(hash_function, - *content); + ? ArtifactDigestFactory::HashDataAs( + hash_function, *content) + : ArtifactDigestFactory::HashDataAs( + hash_function, *content); // Collect blob and upload to remote CAS if transfer size reached. if (not UpdateContainerAndUpload( -- cgit v1.2.3