summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/serve_service/source_tree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/serve_api/serve_service/source_tree.cpp')
-rw-r--r--src/buildtool/serve_api/serve_service/source_tree.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/buildtool/serve_api/serve_service/source_tree.cpp b/src/buildtool/serve_api/serve_service/source_tree.cpp
index 74edaca8..480dfd34 100644
--- a/src/buildtool/serve_api/serve_service/source_tree.cpp
+++ b/src/buildtool/serve_api/serve_service/source_tree.cpp
@@ -895,20 +895,21 @@ auto SourceTreeService::DistdirImportToGit(
auto const& tmp_path = distdir_tmp_dir->GetPath();
// link the CAS blobs into the tmp dir
auto const& cas = storage_.CAS();
- if (not std::all_of(content_list.begin(),
- content_list.end(),
- [&cas, tmp_path](auto const& kv) {
- auto content_path = cas.BlobPath(
- ArtifactDigest(
- kv.second.first, 0, /*is_tree=*/false),
- kv.second.second);
- if (content_path) {
- return FileSystemManager::CreateFileHardlink(
- *content_path, // from: cas_path/content_id
- tmp_path / kv.first); // to: tmp_path/name
- }
- return false;
- })) {
+ if (not std::all_of(
+ content_list.begin(),
+ content_list.end(),
+ [&cas, tmp_path](auto const& kv) {
+ auto content_path = cas.BlobPath(
+ ArtifactDigest(kv.second.first, 0, /*is_tree=*/false),
+ kv.second.second);
+ if (content_path) {
+ return FileSystemManager::CreateFileHardlink(
+ *content_path, // from: cas_path/content_id
+ tmp_path / kv.first) // to: tmp_path/name
+ .has_value();
+ }
+ return false;
+ })) {
logger_->Emit(LogLevel::Error,
"Failed to create links to CAS content {}",
content_id);