diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-26 16:07:58 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-05 12:58:35 +0200 |
commit | 5bc6265b2ffe43370b4cddd0a9e4c09b059ef131 (patch) | |
tree | 63619c3d43f97c4ffa16feb9094fc8631620b164 /src/other_tools/git_operations/git_repo_remote.cpp | |
parent | 3440784e94de51c95d3dcca8509f8e46b4722ee6 (diff) | |
download | justbuild-5bc6265b2ffe43370b4cddd0a9e4c09b059ef131.tar.gz |
Pass StorageConfig to git_repo and git_repo_remote
Diffstat (limited to 'src/other_tools/git_operations/git_repo_remote.cpp')
-rw-r--r-- | src/other_tools/git_operations/git_repo_remote.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/other_tools/git_operations/git_repo_remote.cpp b/src/other_tools/git_operations/git_repo_remote.cpp index 80a2f956..00114b50 100644 --- a/src/other_tools/git_operations/git_repo_remote.cpp +++ b/src/other_tools/git_operations/git_repo_remote.cpp @@ -22,7 +22,6 @@ #include "src/buildtool/file_system/git_utils.hpp" #include "src/buildtool/logging/log_level.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" @@ -397,6 +396,7 @@ auto GitRepoRemote::FetchFromRemote(std::shared_ptr<git_config> cfg, } auto GitRepoRemote::UpdateCommitViaTmpRepo( + StorageConfig const& storage_config, std::string const& repo_url, std::string const& branch, std::vector<std::string> const& inherit_env, @@ -405,7 +405,7 @@ auto GitRepoRemote::UpdateCommitViaTmpRepo( anon_logger_ptr const& logger) const noexcept -> std::optional<std::string> { try { - auto tmp_dir = StorageConfig::Instance().CreateTypedTmpDir("update"); + auto tmp_dir = storage_config.CreateTypedTmpDir("update"); if (not tmp_dir) { (*logger)("Failed to create temp dir for running 'git ls-remote'", /*fatal=*/true); @@ -532,7 +532,8 @@ auto GitRepoRemote::UpdateCommitViaTmpRepo( } } -auto GitRepoRemote::FetchViaTmpRepo(std::string const& repo_url, +auto GitRepoRemote::FetchViaTmpRepo(StorageConfig const& storage_config, + std::string const& repo_url, std::optional<std::string> const& branch, std::vector<std::string> const& inherit_env, std::string const& git_bin, @@ -540,7 +541,7 @@ auto GitRepoRemote::FetchViaTmpRepo(std::string const& repo_url, anon_logger_ptr const& logger) noexcept -> bool { try { - auto tmp_dir = StorageConfig::Instance().CreateTypedTmpDir("fetch"); + auto tmp_dir = storage_config.CreateTypedTmpDir("fetch"); if (not tmp_dir) { (*logger)("Failed to create temp dir for running 'git fetch'", /*fatal=*/true); |