From 0d3860c4bbfe81c7003f0ea1f1a01fc3a866daed Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 22 Jan 2024 18:40:37 +0100 Subject: just-mr async maps: Wrap passed raw pointers This is to uphold the coding style guide we employ. --- src/other_tools/root_maps/commit_git_map.cpp | 41 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'src/other_tools/root_maps/commit_git_map.cpp') diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp index 0461f474..c17550f0 100644 --- a/src/other_tools/root_maps/commit_git_map.cpp +++ b/src/other_tools/root_maps/commit_git_map.cpp @@ -88,22 +88,23 @@ void WriteIdFileAndSetWSRoot(std::string const& root_tree_id, false)); } -void EnsureCommit(GitRepoInfo const& repo_info, - std::filesystem::path const& repo_root, - std::string const& fetch_repo, - MirrorsPtr const& additional_mirrors, - GitCASPtr const& git_cas, - gsl::not_null const& critical_git_op_map, - gsl::not_null const& import_to_git_map, - std::string const& git_bin, - std::vector const& launcher, - bool serve_api_exists, - IExecutionApi* local_api, - IExecutionApi* remote_api, - bool fetch_absent, - gsl::not_null const& ts, - CommitGitMap::SetterPtr const& ws_setter, - CommitGitMap::LoggerPtr const& logger) { +void EnsureCommit( + GitRepoInfo const& repo_info, + std::filesystem::path const& repo_root, + std::string const& fetch_repo, + MirrorsPtr const& additional_mirrors, + GitCASPtr const& git_cas, + gsl::not_null const& critical_git_op_map, + gsl::not_null const& import_to_git_map, + std::string const& git_bin, + std::vector const& launcher, + bool serve_api_exists, + gsl::not_null const& local_api, + std::optional> const& remote_api, + bool fetch_absent, + gsl::not_null const& ts, + CommitGitMap::SetterPtr const& ws_setter, + CommitGitMap::LoggerPtr const& logger) { // ensure commit exists, and fetch if needed auto git_repo = GitRepoRemote::Open(git_cas); // link fake repo to odb if (not git_repo) { @@ -242,8 +243,8 @@ void EnsureCommit(GitRepoInfo const& repo_info, // try to get root tree from remote execution endpoint auto root_digest = ArtifactDigest{*root_tree_id, 0, /*is_tree=*/true}; - if (remote_api != nullptr and local_api != nullptr and - remote_api->RetrieveToCas( + if (remote_api and + remote_api.value()->RetrieveToCas( {Artifact::ObjectInfo{.digest = root_digest, .type = ObjectType::Tree}}, local_api)) { @@ -672,8 +673,8 @@ auto CreateCommitGitMap( std::string const& git_bin, std::vector const& launcher, bool serve_api_exists, - IExecutionApi* local_api, - IExecutionApi* remote_api, + gsl::not_null const& local_api, + std::optional> const& remote_api, bool fetch_absent, std::size_t jobs) -> CommitGitMap { auto commit_to_git = [critical_git_op_map, -- cgit v1.2.3