From ee6f54124360d8a72b9b545dcc581f3c80d3c8a9 Mon Sep 17 00:00:00 2001 From: Sascha Roloff Date: Mon, 11 Jul 2022 19:55:10 +0200 Subject: Modified artifact digest to provide wire digest on demand --- src/buildtool/file_system/file_root.hpp | 8 ++++++-- 1 file changed, 6 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 747ca896..872ae1ff 100644 --- a/src/buildtool/file_system/file_root.hpp +++ b/src/buildtool/file_system/file_root.hpp @@ -399,6 +399,7 @@ class FileRoot { } // Create LOCAL or KNOWN artifact. Does not check existence for LOCAL. + // `file_path` must reference a blob. [[nodiscard]] auto ToArtifactDescription( std::filesystem::path const& file_path, std::string const& repository) const noexcept @@ -412,11 +413,14 @@ class FileRoot { auto compatible_hash = Compatibility::RegisterGitEntry( entry->Hash(), *entry->Blob(), repository); return ArtifactDescription{ - ArtifactDigest{compatible_hash, *entry->Size()}, + ArtifactDigest{compatible_hash, + *entry->Size(), + /*is_tree=*/false}, entry->Type()}; } return ArtifactDescription{ - ArtifactDigest{entry->Hash(), *entry->Size()}, + ArtifactDigest{ + entry->Hash(), *entry->Size(), /*is_tree=*/false}, entry->Type(), repository}; } -- cgit v1.2.3