From 59a0ce6d9df4465f2a7e6cbeb78a339f30574ae6 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 16 Sep 2024 15:31:15 +0200 Subject: Small code improvements based on lint warnings - add more noexcept requirements and enforce existing - fixing inconsistencies related to function arguments - remove redundant static keywords - silencing excessive lint reporting in test cases While there, make more getters const ref. --- src/buildtool/serve_api/serve_service/source_tree.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/buildtool/serve_api/serve_service/source_tree.cpp') diff --git a/src/buildtool/serve_api/serve_service/source_tree.cpp b/src/buildtool/serve_api/serve_service/source_tree.cpp index 567d61bb..5aae6e07 100644 --- a/src/buildtool/serve_api/serve_service/source_tree.cpp +++ b/src/buildtool/serve_api/serve_service/source_tree.cpp @@ -461,7 +461,7 @@ auto SourceTreeService::ResolveContentTree( } auto SourceTreeService::CommonImportToGit( - std::filesystem::path const& content_path, + std::filesystem::path const& root_path, std::string const& commit_message) -> expected { // the repository path that imports the content must be separate from the // content path, to avoid polluting the entries @@ -481,18 +481,18 @@ auto SourceTreeService::CommonImportToGit( // wrap logger for GitRepo call std::string err; auto wrapped_logger = std::make_shared( - [content_path, repo_path, &err](auto const& msg, bool fatal) { + [&root_path, &repo_path, &err](auto const& msg, bool fatal) { if (fatal) { err = fmt::format( "While committing directory {} in repository {}:\n{}", - content_path.string(), + root_path.string(), repo_path.string(), msg); } }); // stage and commit all auto commit_hash = - git_repo->CommitDirectory(content_path, commit_message, wrapped_logger); + git_repo->CommitDirectory(root_path, commit_message, wrapped_logger); if (not commit_hash) { return unexpected{err}; } -- cgit v1.2.3