summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/serve_service/source_tree.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-09-16 15:31:15 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-09-17 14:43:21 +0200
commit59a0ce6d9df4465f2a7e6cbeb78a339f30574ae6 (patch)
tree8c42280acfc5603bcf1f4734cf29a05d0263286e /src/buildtool/serve_api/serve_service/source_tree.cpp
parenta1b45eef0a50da931a2c46fe842631d27ca4be56 (diff)
downloadjustbuild-59a0ce6d9df4465f2a7e6cbeb78a339f30574ae6.tar.gz
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.
Diffstat (limited to 'src/buildtool/serve_api/serve_service/source_tree.cpp')
-rw-r--r--src/buildtool/serve_api/serve_service/source_tree.cpp8
1 files changed, 4 insertions, 4 deletions
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<std::string, std::string> {
// 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<GitRepo::anon_logger_t>(
- [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};
}