diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-28 12:02:14 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-05 13:32:39 +0200 |
commit | 849671f3d4ea482d208da4b5adf5c2c3556e25e4 (patch) | |
tree | c4464ebd7bd88a3785c6337c2788d6e8b449fa22 /src/other_tools/ops_maps/git_update_map.cpp | |
parent | 3c7f2481918289e8d47922df1c87a7ae77357749 (diff) | |
download | justbuild-849671f3d4ea482d208da4b5adf5c2c3556e25e4.tar.gz |
Pass StorageConfig and Storage to just-mr maps
Diffstat (limited to 'src/other_tools/ops_maps/git_update_map.cpp')
-rw-r--r-- | src/other_tools/ops_maps/git_update_map.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/other_tools/ops_maps/git_update_map.cpp b/src/other_tools/ops_maps/git_update_map.cpp index 143000bc..de3bfb25 100644 --- a/src/other_tools/ops_maps/git_update_map.cpp +++ b/src/other_tools/ops_maps/git_update_map.cpp @@ -16,20 +16,22 @@ #include "fmt/core.h" #include "src/buildtool/execution_api/local/config.hpp" -#include "src/buildtool/storage/config.hpp" #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" -auto CreateGitUpdateMap(GitCASPtr const& git_cas, - std::string const& git_bin, - std::vector<std::string> const& launcher, - std::size_t jobs) -> GitUpdateMap { - auto update_commits = [git_cas, git_bin, launcher](auto /* unused */, - auto setter, - auto logger, - auto /* unused */, - auto const& key) { +auto CreateGitUpdateMap( + GitCASPtr const& git_cas, + std::string const& git_bin, + std::vector<std::string> const& launcher, + gsl::not_null<StorageConfig const*> const& storage_config, + std::size_t jobs) -> GitUpdateMap { + auto update_commits = [git_cas, git_bin, launcher, storage_config]( + auto /* unused */, + auto setter, + auto logger, + auto /* unused */, + auto const& key) { // perform git update commit auto git_repo = GitRepoRemote::Open(git_cas); // wrap the tmp odb if (not git_repo) { @@ -49,14 +51,13 @@ 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(StorageConfig::Instance(), - key.repo, - key.branch, - key.inherit_env, - git_bin, - launcher, - wrapped_logger); + auto new_commit = git_repo->UpdateCommitViaTmpRepo(*storage_config, + key.repo, + key.branch, + key.inherit_env, + git_bin, + launcher, + wrapped_logger); JustMRProgress::Instance().TaskTracker().Stop(id); if (not new_commit) { return; |