summaryrefslogtreecommitdiff
path: root/src/other_tools/root_maps/distdir_git_map.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-25 16:14:51 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-06-27 11:24:20 +0200
commit4625d391cad4d04f9adca4484da687b2adb1fed6 (patch)
tree4f4a3e19e78324e6abe3a6ac1209cad3d8a50cb0 /src/other_tools/root_maps/distdir_git_map.cpp
parent70a854c2ce90194a943b6e007a1515dfc87314eb (diff)
downloadjustbuild-4625d391cad4d04f9adca4484da687b2adb1fed6.tar.gz
Use a raw pointer for passing optional IExecutionApi
...instead of std::optional<gsl::not_null<IExecutionApi const*>>
Diffstat (limited to 'src/other_tools/root_maps/distdir_git_map.cpp')
-rw-r--r--src/other_tools/root_maps/distdir_git_map.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/other_tools/root_maps/distdir_git_map.cpp b/src/other_tools/root_maps/distdir_git_map.cpp
index f21994ba..bc9838eb 100644
--- a/src/other_tools/root_maps/distdir_git_map.cpp
+++ b/src/other_tools/root_maps/distdir_git_map.cpp
@@ -134,7 +134,7 @@ auto CreateDistdirGitMap(
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
std::optional<ServeApi> const& serve,
gsl::not_null<IExecutionApi const*> const& local_api,
- IExecutionApi::OptionalPtr const& remote_api,
+ IExecutionApi const* remote_api,
std::size_t jobs) -> DistdirGitMap {
auto distdir_to_git = [content_cas_map,
import_to_git_map,
@@ -236,7 +236,7 @@ auto CreateDistdirGitMap(
/*fatal=*/true);
return;
}
- if (not remote_api) {
+ if (remote_api == nullptr) {
(*logger)(
fmt::format(
"Missing or incompatible "
@@ -254,7 +254,7 @@ auto CreateDistdirGitMap(
*serve,
distdir_tree_id,
StorageConfig::GitRoot(),
- &(*remote_api.value()),
+ remote_api,
logger,
true /*no_sync_is_fatal*/)) {
return;
@@ -384,7 +384,7 @@ auto CreateDistdirGitMap(
return;
}
// we cannot continue without a suitable remote set up
- if (not remote_api) {
+ if (remote_api == nullptr) {
(*logger)(fmt::format(
"Cannot create workspace root {} as "
"absent for the provided serve endpoint.",
@@ -394,14 +394,14 @@ auto CreateDistdirGitMap(
}
// try to supply the serve endpoint with the tree via the
// remote CAS
- if (remote_api.value()->IsAvailable({digest})) {
+ if (remote_api->IsAvailable({digest})) {
// tell serve to set up the root from the remote CAS
// tree; upload can be skipped
if (EnsureAbsentRootOnServe(
*serve,
tree_id,
/*repo_path=*/"",
- /*remote_api=*/std::nullopt,
+ /*remote_api=*/nullptr,
logger,
/*no_sync_is_fatal=*/true)) {
// set workspace root as absent
@@ -425,7 +425,7 @@ auto CreateDistdirGitMap(
{Artifact::ObjectInfo{
.digest = digest,
.type = ObjectType::Tree}},
- **remote_api)) {
+ *remote_api)) {
(*logger)(fmt::format("Failed to sync tree {} from "
"local CAS with remote CAS.",
tree_id),
@@ -438,7 +438,7 @@ auto CreateDistdirGitMap(
*serve,
tree_id,
/*repo_path=*/"",
- /*remote_api=*/std::nullopt,
+ /*remote_api=*/nullptr,
logger,
/*no_sync_is_fatal=*/true)) {
// set workspace root as absent
@@ -483,7 +483,7 @@ auto CreateDistdirGitMap(
}
// now ask serve endpoint if it can set up the root; as this is for
// a present root, a corresponding remote endpoint is needed
- if (serve and remote_api) {
+ if (serve and remote_api != nullptr) {
auto serve_result =
serve->RetrieveTreeFromDistdir(key.content_list,
/*sync_tree=*/true);