summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/serve_service/source_tree.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/buildtool/serve_api/serve_service/source_tree.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/buildtool/serve_api/serve_service/source_tree.cpp')
-rw-r--r--src/buildtool/serve_api/serve_service/source_tree.cpp10
1 files changed, 1 insertions, 9 deletions
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);