From 3ea705c630b438fd6513fd6190190a559060f341 Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Thu, 21 Apr 2022 14:43:02 +0200 Subject: add compatibility with original remote build protocol --- src/buildtool/file_system/file_root.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (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 58f521cd..c374e937 100644 --- a/src/buildtool/file_system/file_root.hpp +++ b/src/buildtool/file_system/file_root.hpp @@ -12,6 +12,7 @@ #include "gsl-lite/gsl-lite.hpp" #include "src/buildtool/common/artifact_description.hpp" +#include "src/buildtool/compatibility/compatibility.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/git_tree.hpp" #include "src/utils/cpp/concepts.hpp" @@ -387,6 +388,13 @@ class FileRoot { std::get(root_).tree->LookupEntryByPath( file_path)) { if (entry->IsBlob()) { + if (Compatibility::IsCompatible()) { + auto compatible_hash = Compatibility::RegisterGitEntry( + entry->Hash(), *entry->Blob(), repository); + return ArtifactDescription{ + ArtifactDigest{compatible_hash, *entry->Size()}, + entry->Type()}; + } return ArtifactDescription{ ArtifactDigest{entry->Hash(), *entry->Size()}, entry->Type(), -- cgit v1.2.3