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/other_tools/ops_maps/git_update_map.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/other_tools/ops_maps/git_update_map.cpp') diff --git a/src/other_tools/ops_maps/git_update_map.cpp b/src/other_tools/ops_maps/git_update_map.cpp index 0ce9de49..9886b84b 100644 --- a/src/other_tools/ops_maps/git_update_map.cpp +++ b/src/other_tools/ops_maps/git_update_map.cpp @@ -19,7 +19,6 @@ #include "src/buildtool/storage/fs_utils.hpp" #include "src/other_tools/just_mr/progress_reporting/progress.hpp" #include "src/other_tools/just_mr/progress_reporting/statistics.hpp" -#include "src/utils/cpp/tmp_dir.hpp" auto CreateGitUpdateMap(GitCASPtr const& git_cas, std::string const& git_bin, @@ -39,14 +38,6 @@ auto CreateGitUpdateMap(GitCASPtr const& git_cas, /*fatal=*/true); return; } - auto tmp_dir = StorageUtils::CreateTypedTmpDir("update"); - if (not tmp_dir) { - (*logger)(fmt::format("Failed to create commit update tmp dir for " - "remote {}", - key.repo), - /*fatal=*/true); - return; - } // setup wrapped logger auto wrapped_logger = std::make_shared( [logger](auto const& msg, bool fatal) { @@ -57,8 +48,7 @@ auto CreateGitUpdateMap(GitCASPtr const& git_cas, // update commit auto id = fmt::format("{}:{}", key.repo, key.branch); JustMRProgress::Instance().TaskTracker().Start(id); - auto new_commit = git_repo->UpdateCommitViaTmpRepo(tmp_dir->GetPath(), - key.repo, + auto new_commit = git_repo->UpdateCommitViaTmpRepo(key.repo, key.branch, key.inherit_env, git_bin, -- cgit v1.2.3