From 8669d48933731f224474a9b1dc55824f87ae26a7 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 25 Jul 2024 14:53:18 +0200 Subject: Use LocalContext in execution and serve services The context is passed by not_null const pointer in order to avoid binding to temporaries, and it or parts of it get stored by const ref where needed. --- src/buildtool/serve_api/serve_service/source_tree.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/buildtool/serve_api/serve_service/source_tree.hpp') diff --git a/src/buildtool/serve_api/serve_service/source_tree.hpp b/src/buildtool/serve_api/serve_service/source_tree.hpp index 2f6d649c..288e7da8 100644 --- a/src/buildtool/serve_api/serve_service/source_tree.hpp +++ b/src/buildtool/serve_api/serve_service/source_tree.hpp @@ -29,6 +29,7 @@ #include "src/buildtool/common/remote/remote_common.hpp" #include "src/buildtool/execution_api/common/api_bundle.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" +#include "src/buildtool/execution_api/local/context.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/git_types.hpp" #include "src/buildtool/file_system/symlinks_map/pragma_special.hpp" @@ -61,12 +62,11 @@ class SourceTreeService final explicit SourceTreeService( gsl::not_null const& serve_config, - gsl::not_null const& storage_config, - gsl::not_null const& storage, + gsl::not_null const& local_context, gsl::not_null const& apis) noexcept : serve_config_{*serve_config}, - storage_{*storage}, - storage_config_{*storage_config}, + storage_{*local_context->storage}, + storage_config_{*local_context->storage_config}, apis_{*apis} {} // Retrieve the Git-subtree identifier from a given Git commit. -- cgit v1.2.3