summaryrefslogtreecommitdiff
path: root/src/other_tools/git_operations/git_repo_remote.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-12 18:04:22 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-03-13 12:14:53 +0100
commit4a9d15ec0340516b5a017540d1d5f0eb9a95dbaa (patch)
tree19bd0098a8b903382fec84bbc60ae8c783b00ba1 /src/other_tools/git_operations/git_repo_remote.cpp
parent2bd069cdecb5371d906f8df9f5fb36f308d6296f (diff)
downloadjustbuild-4a9d15ec0340516b5a017540d1d5f0eb9a95dbaa.tar.gz
Fix tmpdir location
Commit 2ebf355989eb92ac9967eceee0af14d39477afe0 moved the tmpdir creation for various tasks into the task itself. In doing so, TmpDir was called with a relative path; that was, however, is interpreted relative to the working directory, violating the property that our tool never write anything outside the local build root unless explicitly asked to do so (by specifying the output path in an install or install-cas invocation). Fix this, by calling the the tmp-dir function that is storage-layout aware.
Diffstat (limited to 'src/other_tools/git_operations/git_repo_remote.cpp')
-rw-r--r--src/other_tools/git_operations/git_repo_remote.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/other_tools/git_operations/git_repo_remote.cpp b/src/other_tools/git_operations/git_repo_remote.cpp
index a64a6de5..5b1a9750 100644
--- a/src/other_tools/git_operations/git_repo_remote.cpp
+++ b/src/other_tools/git_operations/git_repo_remote.cpp
@@ -18,9 +18,9 @@
#include "nlohmann/json.hpp"
#include "src/buildtool/file_system/git_utils.hpp"
#include "src/buildtool/logging/logger.hpp"
+#include "src/buildtool/storage/config.hpp"
#include "src/buildtool/system/system_command.hpp"
#include "src/other_tools/git_operations/git_config_settings.hpp"
-#include "src/utils/cpp/tmp_dir.hpp"
extern "C" {
#include <git2.h>
@@ -401,7 +401,7 @@ auto GitRepoRemote::UpdateCommitViaTmpRepo(
anon_logger_ptr const& logger) const noexcept
-> std::optional<std::string> {
try {
- auto tmp_dir = TmpDir::Create("update");
+ auto tmp_dir = StorageConfig::CreateTypedTmpDir("update");
if (not tmp_dir) {
(*logger)("Failed to create temp dir for running 'git ls-remote'",
/*fatal=*/true);
@@ -536,7 +536,7 @@ auto GitRepoRemote::FetchViaTmpRepo(std::string const& repo_url,
anon_logger_ptr const& logger) noexcept
-> bool {
try {
- auto tmp_dir = TmpDir::Create("fetch");
+ auto tmp_dir = StorageConfig::CreateTypedTmpDir("fetch");
if (not tmp_dir) {
(*logger)("Failed to create temp dir for running 'git fetch'",
/*fatal=*/true);