From add0ff5993a261f72aabf461a32314e11fea90ba Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 12 Sep 2024 12:02:28 +0200 Subject: Pass HashFunction::Type to FileRoot::AsKnownTree ...to get the protocol type. --- src/buildtool/file_system/file_root.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/buildtool/file_system/file_root.hpp') diff --git a/src/buildtool/file_system/file_root.hpp b/src/buildtool/file_system/file_root.hpp index 50065bfd..6a34409c 100644 --- a/src/buildtool/file_system/file_root.hpp +++ b/src/buildtool/file_system/file_root.hpp @@ -222,9 +222,10 @@ class FileRoot { /// \brief Retrieve a root tree as a KNOWN artifact. /// Only succeeds if no entries have to be ignored. - [[nodiscard]] auto AsKnownTree(std::string const& repository) + [[nodiscard]] auto AsKnownTree(HashFunction::Type hash_type, + std::string const& repository) const noexcept -> std::optional { - if (ProtocolTraits::Instance().IsCompatible()) { + if (not ProtocolTraits::IsNative(hash_type)) { return std::nullopt; } if (std::holds_alternative(data_)) { -- cgit v1.2.3