From 5bc6265b2ffe43370b4cddd0a9e4c09b059ef131 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Wed, 26 Jun 2024 16:07:58 +0200 Subject: Pass StorageConfig to git_repo and git_repo_remote --- src/other_tools/git_operations/git_repo_remote.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/other_tools/git_operations/git_repo_remote.cpp') 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 cfg, } auto GitRepoRemote::UpdateCommitViaTmpRepo( + StorageConfig const& storage_config, std::string const& repo_url, std::string const& branch, std::vector const& inherit_env, @@ -405,7 +405,7 @@ auto GitRepoRemote::UpdateCommitViaTmpRepo( anon_logger_ptr const& logger) const noexcept -> std::optional { 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 const& branch, std::vector 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); -- cgit v1.2.3