From 22ddf965548a648a577f732007b67b26036ce685 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 11 Dec 2024 14:38:15 +0100 Subject: RepositoryConfig::SetGitCAS: allow setting log_level ... as there might be cases where it is expected that setting the git CAS fails, e.g., if referring to the implict git repository in the local build root as a fallback CAS. --- src/buildtool/common/TARGETS | 1 + src/buildtool/common/repository_config.hpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/buildtool/common/TARGETS b/src/buildtool/common/TARGETS index 791b2ac3..4a802b82 100644 --- a/src/buildtool/common/TARGETS +++ b/src/buildtool/common/TARGETS @@ -164,6 +164,7 @@ , ["src/buildtool/file_system", "file_root"] , ["src/buildtool/file_system", "git_cas"] , ["src/buildtool/file_system", "git_tree"] + , ["src/buildtool/logging", "log_level"] , ["src/buildtool/multithreading", "atomic_value"] , ["src/buildtool/storage", "storage"] ] diff --git a/src/buildtool/common/repository_config.hpp b/src/buildtool/common/repository_config.hpp index 0060152d..218cd14d 100644 --- a/src/buildtool/common/repository_config.hpp +++ b/src/buildtool/common/repository_config.hpp @@ -31,6 +31,7 @@ #include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/file_system/git_cas.hpp" #include "src/buildtool/file_system/git_tree.hpp" +#include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/multithreading/atomic_value.hpp" #include "src/buildtool/storage/storage.hpp" @@ -61,8 +62,9 @@ class RepositoryConfig { } [[nodiscard]] auto SetGitCAS( - std::filesystem::path const& repo_path) noexcept { - git_cas_ = GitCAS::Open(repo_path); + std::filesystem::path const& repo_path, + LogLevel log_level = LogLevel::Warning) noexcept -> bool { + git_cas_ = GitCAS::Open(repo_path, log_level); return static_cast(git_cas_); } -- cgit v1.2.3