summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/fetch.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-01-22 18:40:37 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-01-26 14:51:43 +0100
commit0d3860c4bbfe81c7003f0ea1f1a01fc3a866daed (patch)
treea31eca399b533159f636c194d288716b4abdf7d8 /src/other_tools/just_mr/fetch.cpp
parent395c0c8cffc97ae6e29f12715bb5496db121ae01 (diff)
downloadjustbuild-0d3860c4bbfe81c7003f0ea1f1a01fc3a866daed.tar.gz
just-mr async maps: Wrap passed raw pointers
This is to uphold the coding style guide we employ.
Diffstat (limited to 'src/other_tools/just_mr/fetch.cpp')
-rw-r--r--src/other_tools/just_mr/fetch.cpp57
1 files changed, 31 insertions, 26 deletions
diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp
index a51307da..083284b9 100644
--- a/src/other_tools/just_mr/fetch.cpp
+++ b/src/other_tools/just_mr/fetch.cpp
@@ -456,8 +456,7 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config,
// setup the APIs for archive fetches
auto remote_api = JustMR::Utils::GetRemoteApi(
common_args.remote_execution_address, auth_args);
- IExecutionApi::Ptr local_api{remote_api ? std::make_unique<LocalApi>()
- : nullptr};
+ IExecutionApi::Ptr local_api{std::make_unique<LocalApi>()};
// setup the API for serving trees of Git repos or archives
auto serve_api_exists = JustMR::Utils::SetupServeApi(
@@ -466,36 +465,42 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config,
// create async maps
auto crit_git_op_ptr = std::make_shared<CriticalGitOpGuard>();
auto critical_git_op_map = CreateCriticalGitOpMap(crit_git_op_ptr);
- auto content_cas_map =
- CreateContentCASMap(common_args.just_mr_paths,
- common_args.alternative_mirrors,
- common_args.ca_info,
- &critical_git_op_map,
- serve_api_exists,
- local_api ? &(*local_api) : nullptr,
- remote_api ? &(*remote_api) : nullptr,
- common_args.jobs);
- auto archive_fetch_map = CreateArchiveFetchMap(
- &content_cas_map,
- *fetch_dir,
- (fetch_args.backup_to_remote and local_api) ? &(*local_api) : nullptr,
- (fetch_args.backup_to_remote and remote_api) ? &(*remote_api) : nullptr,
+
+ auto content_cas_map = CreateContentCASMap(
+ common_args.just_mr_paths,
+ common_args.alternative_mirrors,
+ common_args.ca_info,
+ &critical_git_op_map,
+ serve_api_exists,
+ &(*local_api),
+ remote_api ? std::make_optional(&(*remote_api)) : std::nullopt,
common_args.jobs);
+
+ auto archive_fetch_map =
+ CreateArchiveFetchMap(&content_cas_map,
+ *fetch_dir,
+ &(*local_api),
+ (fetch_args.backup_to_remote and remote_api)
+ ? std::make_optional(&(*remote_api))
+ : std::nullopt,
+ common_args.jobs);
+
auto import_to_git_map =
CreateImportToGitMap(&critical_git_op_map,
common_args.git_path->string(),
*common_args.local_launcher,
common_args.jobs);
- auto git_tree_fetch_map =
- CreateGitTreeFetchMap(&critical_git_op_map,
- &import_to_git_map,
- common_args.git_path->string(),
- *common_args.local_launcher,
- serve_api_exists,
- local_api ? &(*local_api) : nullptr,
- remote_api ? &(*remote_api) : nullptr,
- fetch_args.backup_to_remote,
- common_args.jobs);
+
+ auto git_tree_fetch_map = CreateGitTreeFetchMap(
+ &critical_git_op_map,
+ &import_to_git_map,
+ common_args.git_path->string(),
+ *common_args.local_launcher,
+ serve_api_exists,
+ &(*local_api),
+ remote_api ? std::make_optional(&(*remote_api)) : std::nullopt,
+ fetch_args.backup_to_remote,
+ common_args.jobs);
// set up progress observer
JustMRProgress::Instance().SetTotal(static_cast<int>(nr_a + nr_gt));