summaryrefslogtreecommitdiff
path: root/src/other_tools/ops_maps
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/ops_maps')
-rw-r--r--src/other_tools/ops_maps/TARGETS1
-rw-r--r--src/other_tools/ops_maps/git_tree_fetch_map.cpp32
-rw-r--r--src/other_tools/ops_maps/git_update_map.cpp12
-rw-r--r--src/other_tools/ops_maps/import_to_git_map.cpp12
4 files changed, 11 insertions, 46 deletions
diff --git a/src/other_tools/ops_maps/TARGETS b/src/other_tools/ops_maps/TARGETS
index 41f73000..4a15849f 100644
--- a/src/other_tools/ops_maps/TARGETS
+++ b/src/other_tools/ops_maps/TARGETS
@@ -48,7 +48,6 @@
[ ["@", "fmt", "", "fmt"]
, ["src/buildtool/execution_api/local", "config"]
, ["src/buildtool/storage", "fs_utils"]
- , ["src/utils/cpp", "tmp_dir"]
, ["src/other_tools/just_mr/progress_reporting", "statistics"]
, ["src/other_tools/just_mr/progress_reporting", "progress"]
]
diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.cpp b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
index 38e25606..423808cc 100644
--- a/src/other_tools/ops_maps/git_tree_fetch_map.cpp
+++ b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
@@ -419,7 +419,6 @@ auto CreateGitTreeFetchMap(
fatal);
});
if (not just_git_repo->FetchViaTmpRepo(
- tmp_dir->GetPath(),
target_path.string(),
std::nullopt,
key.inherit_env,
@@ -454,12 +453,8 @@ auto CreateGitTreeFetchMap(
critical_git_op_map->ConsumeAfterKeysReady(
ts,
{std::move(op_key)},
- [tmp_dir, // keep tmp_dir alive
- remote_api,
- backup_to_remote,
- key,
- setter,
- logger](auto const& values) {
+ [remote_api, backup_to_remote, key, setter, logger](
+ auto const& values) {
GitOpValue op_result = *values[0];
// check flag
if (not op_result.result) {
@@ -477,28 +472,21 @@ auto CreateGitTreeFetchMap(
// success
(*setter)(false /*no cache hit*/);
},
- [logger,
- commit = *op_result.result,
- target_path = tmp_dir->GetPath()](auto const& msg,
- bool fatal) {
+ [logger, commit = *op_result.result](
+ auto const& msg, bool fatal) {
(*logger)(
fmt::format("While running critical Git op "
- "KEEP_TAG for commit {} in "
- "target {}:\n{}",
+ "KEEP_TAG for commit {}:\n{}",
commit,
- target_path.string(),
msg),
fatal);
});
},
- [logger, target_path = tmp_dir->GetPath()](auto const& msg,
- bool fatal) {
- (*logger)(
- fmt::format("While running critical Git op "
- "INITIAL_COMMIT for target {}:\n{}",
- target_path.string(),
- msg),
- fatal);
+ [logger](auto const& msg, bool fatal) {
+ (*logger)(fmt::format("While running critical Git op "
+ "INITIAL_COMMIT:\n{}",
+ msg),
+ fatal);
});
},
[logger, target_path = StorageConfig::GitRoot()](auto const& msg,
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,
diff --git a/src/other_tools/ops_maps/import_to_git_map.cpp b/src/other_tools/ops_maps/import_to_git_map.cpp
index 4051cb01..991fc369 100644
--- a/src/other_tools/ops_maps/import_to_git_map.cpp
+++ b/src/other_tools/ops_maps/import_to_git_map.cpp
@@ -167,17 +167,6 @@ auto CreateImportToGitMap(
/*fatal=*/true);
return;
}
- // create tmp directory
- auto tmp_dir =
- StorageUtils::CreateTypedTmpDir("import-to-git");
- if (not tmp_dir) {
- (*logger)(
- fmt::format("Could not create unique path "
- "for target {}",
- target_path.string()),
- /*fatal=*/true);
- return;
- }
auto wrapped_logger =
std::make_shared<AsyncMapConsumerLogger>(
[logger, target_path](auto const& msg,
@@ -190,7 +179,6 @@ auto CreateImportToGitMap(
fatal);
});
if (not just_git_repo->FetchViaTmpRepo(
- tmp_dir->GetPath(),
target_path.string(),
std::nullopt,
std::vector<std::string>{} /* XXX */,