From 2ebf355989eb92ac9967eceee0af14d39477afe0 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Fri, 23 Feb 2024 18:51:51 +0100 Subject: just-mr: Fix shell out execution ... by avoiding reusing temp dirs for execute. While we are at it, also refactor LocalFetchViaTmpRepo() to create its own empty temp dirs, that cannot be reused by the caller. --- src/buildtool/serve_api/serve_service/source_tree.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/buildtool/serve_api/serve_service/source_tree.cpp') diff --git a/src/buildtool/serve_api/serve_service/source_tree.cpp b/src/buildtool/serve_api/serve_service/source_tree.cpp index cef433a0..4941f786 100644 --- a/src/buildtool/serve_api/serve_service/source_tree.cpp +++ b/src/buildtool/serve_api/serve_service/source_tree.cpp @@ -477,13 +477,6 @@ auto SourceTreeService::CommonImportToGit( if (not commit_hash) { return result_t(std::in_place_index<0>, err); } - // create a tmp directory for the fetch to Git CAS - auto tmp_dir = StorageUtils::CreateTypedTmpDir("import-to-git"); - if (not tmp_dir) { - return result_t( - std::in_place_index<0>, - std::string("Failed to create tmp path for git import")); - } // open the Git CAS repo auto just_git_cas = GitCAS::Open(StorageConfig::GitRoot()); if (not just_git_cas) { @@ -509,8 +502,7 @@ auto SourceTreeService::CommonImportToGit( }); // fetch the new commit into the Git CAS via tmp directory; the call is // thread-safe, so it needs no guarding - if (not just_git_repo->LocalFetchViaTmpRepo(tmp_dir->GetPath(), - root_path.string(), + if (not just_git_repo->LocalFetchViaTmpRepo(root_path.string(), /*branch=*/std::nullopt, wrapped_logger)) { return result_t(std::in_place_index<0>, err); -- cgit v1.2.3