From 580539ab08a098e7f348fee3c46fbf5d44cd4d54 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 16 May 2024 11:24:14 +0200 Subject: RepositoryConfig: Instance should not be changed once populated Once a RepositoryConfig instance gets populated, it must never be changed again. Therefore, all functions accepting these instances should only take them as pointers to const. --- src/buildtool/execution_engine/executor/executor.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/buildtool/execution_engine/executor/executor.hpp') diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp index f7afb077..37bdb32b 100644 --- a/src/buildtool/execution_engine/executor/executor.hpp +++ b/src/buildtool/execution_engine/executor/executor.hpp @@ -165,7 +165,7 @@ class ExecutorImpl { [[nodiscard]] static auto VerifyOrUploadArtifact( Logger const& logger, gsl::not_null const& artifact, - gsl::not_null const& repo_config, + gsl::not_null const& repo_config, gsl::not_null const& remote_api, gsl::not_null const& local_api) noexcept -> bool { auto const object_info_opt = artifact->Content().Info(); @@ -328,7 +328,7 @@ class ExecutorImpl { [[nodiscard]] static auto VerifyOrUploadGitArtifact( gsl::not_null const& api, std::string const& repo, - gsl::not_null const& repo_config, + gsl::not_null const& repo_config, Artifact::ObjectInfo const& info, std::string const& hash) noexcept -> bool { std::optional content; @@ -367,7 +367,7 @@ class ExecutorImpl { [[nodiscard]] static auto ReadGitBlob( std::string const& repo, - gsl::not_null const& repo_config, + gsl::not_null const& repo_config, std::string const& hash) noexcept -> std::optional { std::optional blob{}; if (auto const* ws_root = repo_config->WorkspaceRoot(repo)) { @@ -383,7 +383,7 @@ class ExecutorImpl { [[nodiscard]] static auto ReadGitTree( std::string const& repo, - gsl::not_null const& repo_config, + gsl::not_null const& repo_config, std::string const& hash) noexcept -> std::optional { std::optional tree{}; if (auto const* ws_root = repo_config->WorkspaceRoot(repo)) { @@ -406,7 +406,7 @@ class ExecutorImpl { [[nodiscard]] static auto VerifyOrUploadKnownArtifact( gsl::not_null const& api, std::string const& repo, - gsl::not_null const& repo_config, + gsl::not_null const& repo_config, Artifact::ObjectInfo const& info) noexcept -> bool { if (Compatibility::IsCompatible()) { auto opt = Compatibility::GetGitEntry(info.digest.hash()); @@ -430,7 +430,7 @@ class ExecutorImpl { [[nodiscard]] static auto UploadFile( gsl::not_null const& api, std::string const& repo, - gsl::not_null const& repo_config, + gsl::not_null const& repo_config, std::filesystem::path const& file_path) noexcept -> std::optional { auto const* ws_root = repo_config->WorkspaceRoot(repo); @@ -684,7 +684,7 @@ class Executor { public: explicit Executor( - gsl::not_null const& repo_config, + gsl::not_null const& repo_config, gsl::not_null const& local_api, gsl::not_null const& remote_api, std::map properties, @@ -770,7 +770,7 @@ class Executor { } private: - gsl::not_null repo_config_; + gsl::not_null repo_config_; gsl::not_null local_api_; gsl::not_null remote_api_; std::map properties_; @@ -794,7 +794,7 @@ class Rebuilder { /// \param properties Platform properties for execution. /// \param timeout Timeout for action execution. Rebuilder( - gsl::not_null const& repo_config, + gsl::not_null const& repo_config, gsl::not_null const& local_api, gsl::not_null const& remote_api, gsl::not_null const& api_cached, @@ -882,7 +882,7 @@ class Rebuilder { } private: - gsl::not_null repo_config_; + gsl::not_null repo_config_; gsl::not_null local_api_; gsl::not_null remote_api_; gsl::not_null api_cached_; -- cgit v1.2.3