diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-11 10:21:13 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-13 14:41:00 +0200 |
commit | ddf48a60029bed958fb2cf0238dbb0bca0b770fb (patch) | |
tree | 6c42568d14624a36a4f9b07d578d2a001764065d /src/buildtool/common/bazel_digest_factory.cpp | |
parent | f60d39620b29aeaf1addeb244bdd6e15ddf4894c (diff) | |
download | justbuild-ddf48a60029bed958fb2cf0238dbb0bca0b770fb.tar.gz |
Add to ProtocolTraits static functions that provide protocol-specific behaviour
Diffstat (limited to 'src/buildtool/common/bazel_digest_factory.cpp')
-rw-r--r-- | src/buildtool/common/bazel_digest_factory.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 <utility> +#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(); |