diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-05 17:27:13 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-22 17:01:13 +0200 |
commit | dd23c6e397584f4bf1cf84a73d9c382a8ff81de7 (patch) | |
tree | 0f0f600a4674a03da42c07f4ea016ff3c2dc578e /test/utils/blob_creator.hpp | |
parent | beb3faa6956b9bfd58d4ea6644a9b2987409aaba (diff) | |
download | justbuild-dd23c6e397584f4bf1cf84a73d9c382a8ff81de7.tar.gz |
Pass HashFunction to ArtifactDigest::Create
Diffstat (limited to 'test/utils/blob_creator.hpp')
-rw-r--r-- | test/utils/blob_creator.hpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/utils/blob_creator.hpp b/test/utils/blob_creator.hpp index baa7cc86..944fb9d2 100644 --- a/test/utils/blob_creator.hpp +++ b/test/utils/blob_creator.hpp @@ -20,6 +20,7 @@ #include <string> #include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/object_type.hpp" @@ -27,7 +28,8 @@ /// \brief Create a blob from the content found in file or symlink pointed to by /// given path. [[nodiscard]] static inline auto CreateBlobFromPath( - std::filesystem::path const& fpath) noexcept -> std::optional<BazelBlob> { + std::filesystem::path const& fpath, + HashFunction hash_function) noexcept -> std::optional<BazelBlob> { auto const type = FileSystemManager::Type(fpath, /*allow_upwards=*/true); if (not type) { return std::nullopt; @@ -36,9 +38,10 @@ if (not content.has_value()) { return std::nullopt; } - return BazelBlob{ArtifactDigest::Create<ObjectType::File>(*content), - *content, - IsExecutableObject(*type)}; + return BazelBlob{ + ArtifactDigest::Create<ObjectType::File>(hash_function, *content), + *content, + IsExecutableObject(*type)}; } #endif // INCLUDED_SRC_TEST_UTILS_BLOB_CREATOR_HPP |