From ddf48a60029bed958fb2cf0238dbb0bca0b770fb Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Wed, 11 Sep 2024 10:21:13 +0200 Subject: Add to ProtocolTraits static functions that provide protocol-specific behaviour --- src/buildtool/common/bazel_digest_factory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/buildtool/common/bazel_digest_factory.cpp') diff --git a/src/buildtool/common/bazel_digest_factory.cpp b/src/buildtool/common/bazel_digest_factory.cpp index 4ff885aa..3a1f8519 100644 --- a/src/buildtool/common/bazel_digest_factory.cpp +++ b/src/buildtool/common/bazel_digest_factory.cpp @@ -16,12 +16,13 @@ #include +#include "src/buildtool/common/protocol_traits.hpp" #include "src/buildtool/crypto/hasher.hpp" auto BazelDigestFactory::Create(HashInfo const& hash_info, std::int64_t size) noexcept -> bazel_re::Digest { - auto hash = hash_info.HashType() == HashFunction::Type::GitSHA1 + auto hash = ProtocolTraits::IsNative(hash_info.HashType()) ? Prefix(hash_info.Hash(), hash_info.IsTree()) : hash_info.Hash(); -- cgit v1.2.3