diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-02-13 11:18:36 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-02-13 11:25:15 +0100 |
commit | d88898daad7dc654278e3709cf30ead1e4d6c870 (patch) | |
tree | 6beb33e1465a771b6e326bbc40b08ba7c0244114 /src | |
parent | 5a86538ba8056a228337403219801c8de7c1d09c (diff) | |
download | justbuild-d88898daad7dc654278e3709cf30ead1e4d6c870.tar.gz |
local_api: also for retrieve to memory, consult git api as fallback
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/execution_api/local/local_api.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp index dfe8be21..1e3de092 100644 --- a/src/buildtool/execution_api/local/local_api.hpp +++ b/src/buildtool/execution_api/local/local_api.hpp @@ -262,14 +262,15 @@ class LocalApi final : public IExecutionApi { location = storage_->CAS().BlobPath( artifact_info.digest, IsExecutableObject(artifact_info.type)); } - if (not location) { - return std::nullopt; + std::optional<std::string> content = std::nullopt; + if (location) { + content = FileSystemManager::ReadFile(*location); } - auto const content = FileSystemManager::ReadFile(*location); - if (not content) { - return std::nullopt; + if ((not content) and repo_config_) { + content = + GitApi(repo_config_.value()).RetrieveToMemory(artifact_info); } - return *content; + return content; } [[nodiscard]] auto Upload(BlobContainer const& blobs, |