summaryrefslogtreecommitdiff
path: root/src/other_tools/root_maps/content_git_map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/root_maps/content_git_map.cpp')
-rw-r--r--src/other_tools/root_maps/content_git_map.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp
index 6fccb871..f014a227 100644
--- a/src/other_tools/root_maps/content_git_map.cpp
+++ b/src/other_tools/root_maps/content_git_map.cpp
@@ -55,7 +55,7 @@ namespace {
void EnsureRootAsAbsent(
std::string const& tree_id,
ArchiveRepoInfo const& key,
- std::optional<gsl::not_null<const ServeApi*>> const& serve,
+ std::optional<ServeApi> const& serve,
std::optional<gsl::not_null<IExecutionApi*>> const& remote_api,
bool is_cache_hit,
ContentGitMap::SetterPtr const& ws_setter,
@@ -63,7 +63,7 @@ void EnsureRootAsAbsent(
// this is an absent root
if (serve) {
// check if the serve endpoint has this root
- auto has_tree = CheckServeHasAbsentRoot(**serve, tree_id, logger);
+ auto has_tree = CheckServeHasAbsentRoot(*serve, tree_id, logger);
if (not has_tree) {
return;
}
@@ -72,11 +72,11 @@ void EnsureRootAsAbsent(
// root itself; this is redundant if root is not already cached
if (is_cache_hit) {
auto serve_result =
- (*serve)->RetrieveTreeFromArchive(key.archive.content,
- key.repo_type,
- key.subdir,
- key.pragma_special,
- /*sync_tree=*/false);
+ serve->RetrieveTreeFromArchive(key.archive.content,
+ key.repo_type,
+ key.subdir,
+ key.pragma_special,
+ /*sync_tree=*/false);
if (std::holds_alternative<std::string>(serve_result)) {
// if serve has set up the tree, it must match what we
// expect
@@ -117,7 +117,7 @@ void EnsureRootAsAbsent(
// CAS for the serve endpoint to retrieve it and set up the
// root
if (not EnsureAbsentRootOnServe(
- **serve,
+ *serve,
tree_id,
StorageConfig::GitRoot(),
&(*remote_api.value()),
@@ -142,7 +142,7 @@ void EnsureRootAsAbsent(
// the tree is known locally, so we can upload it to remote
// CAS for the serve endpoint to retrieve it and set up the
// root
- if (not EnsureAbsentRootOnServe(**serve,
+ if (not EnsureAbsentRootOnServe(*serve,
tree_id,
StorageConfig::GitRoot(),
&(*remote_api.value()),
@@ -175,7 +175,7 @@ void ResolveContentTree(
GitCASPtr const& just_git_cas,
bool is_cache_hit,
bool is_absent,
- std::optional<gsl::not_null<const ServeApi*>> const& serve,
+ std::optional<ServeApi> const& serve,
std::optional<gsl::not_null<IExecutionApi*>> const& remote_api,
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map,
@@ -231,7 +231,7 @@ void ResolveContentTree(
is_cache_hit,
key,
is_absent,
- serve,
+ &serve,
remote_api,
ts,
ws_setter,
@@ -273,7 +273,7 @@ void ResolveContentTree(
key,
tree_id_file,
is_absent,
- serve,
+ &serve,
remote_api,
is_cache_hit,
ws_setter,
@@ -364,7 +364,7 @@ void WriteIdFileAndSetWSRoot(
GitCASPtr const& just_git_cas,
std::filesystem::path const& archive_tree_id_file,
bool is_absent,
- std::optional<gsl::not_null<const ServeApi*>> const& serve,
+ std::optional<ServeApi> const& serve,
std::optional<gsl::not_null<IExecutionApi*>> const& remote_api,
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map,
@@ -425,7 +425,7 @@ void ExtractAndImportToGit(
std::filesystem::path const& content_cas_path,
std::filesystem::path const& archive_tree_id_file,
bool is_absent,
- std::optional<gsl::not_null<const ServeApi*>> const& serve,
+ std::optional<ServeApi> const& serve,
std::optional<gsl::not_null<IExecutionApi*>> const& remote_api,
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
gsl::not_null<ImportToGitMap*> const& import_to_git_map,
@@ -461,7 +461,7 @@ void ExtractAndImportToGit(
archive_tree_id_file,
key,
is_absent,
- serve,
+ &serve,
remote_api,
critical_git_op_map,
resolve_symlinks_map,
@@ -509,7 +509,7 @@ auto CreateContentGitMap(
CAInfoPtr const& ca_info,
gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map,
gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map,
- std::optional<gsl::not_null<const ServeApi*>> const& serve,
+ std::optional<ServeApi> const& serve,
std::optional<gsl::not_null<IExecutionApi*>> const& remote_api,
bool fetch_absent,
std::size_t jobs) -> ContentGitMap {
@@ -520,7 +520,7 @@ auto CreateContentGitMap(
just_mr_paths,
additional_mirrors,
ca_info,
- serve,
+ &serve,
remote_api,
fetch_absent](auto ts,
auto setter,
@@ -556,7 +556,7 @@ auto CreateContentGitMap(
[archive_tree_id = *archive_tree_id,
key,
fetch_absent,
- serve,
+ &serve,
remote_api,
critical_git_op_map,
resolve_symlinks_map,
@@ -624,12 +624,12 @@ auto CreateContentGitMap(
// request the resolved subdir tree from the serve endpoint, if
// given
if (serve) {
- auto serve_result = (*serve)->RetrieveTreeFromArchive(
- key.archive.content,
- key.repo_type,
- key.subdir,
- key.pragma_special,
- /*sync_tree = */ false);
+ auto serve_result =
+ serve->RetrieveTreeFromArchive(key.archive.content,
+ key.repo_type,
+ key.subdir,
+ key.pragma_special,
+ /*sync_tree = */ false);
if (std::holds_alternative<std::string>(serve_result)) {
// set the workspace root as absent
JustMRProgress::Instance().TaskTracker().Stop(
@@ -702,7 +702,7 @@ auto CreateContentGitMap(
just_mr_paths,
additional_mirrors,
ca_info,
- serve,
+ &serve,
remote_api,
ts,
setter,