diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2022-04-21 14:43:02 +0200 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2022-04-21 14:43:02 +0200 |
commit | 3ea705c630b438fd6513fd6190190a559060f341 (patch) | |
tree | ec0e3fb8c2a2ee157a3c6f480c7edacd8b9174c2 /src/buildtool/file_system/file_root.hpp | |
parent | 9077143d0585ad55f336751a5a5b92d1082438e6 (diff) | |
download | justbuild-3ea705c630b438fd6513fd6190190a559060f341.tar.gz |
add compatibility with original remote build protocol
Diffstat (limited to 'src/buildtool/file_system/file_root.hpp')
-rw-r--r-- | src/buildtool/file_system/file_root.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
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<git_root_t>(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(), |