summaryrefslogtreecommitdiff
path: root/src/other_tools/ops_maps/git_update_map.cpp
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2024-02-23 18:51:51 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2024-03-08 14:16:45 +0100
commit2ebf355989eb92ac9967eceee0af14d39477afe0 (patch)
treedb993f8df39eb05b625b2c4590f1e5696b2e7b04 /src/other_tools/ops_maps/git_update_map.cpp
parentc512ae174920ada425e2b33d0fea24891d6305bd (diff)
downloadjustbuild-2ebf355989eb92ac9967eceee0af14d39477afe0.tar.gz
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.
Diffstat (limited to 'src/other_tools/ops_maps/git_update_map.cpp')
-rw-r--r--src/other_tools/ops_maps/git_update_map.cpp12
1 files changed, 1 insertions, 11 deletions
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<AsyncMapConsumerLogger>(
[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,