summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-12-11 14:38:15 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-12-11 14:58:05 +0100
commit22ddf965548a648a577f732007b67b26036ce685 (patch)
tree899b655652c390f769a3c0e2bf34a9f7377207cf /src
parent877c810528a05015f59caebc2f9999dbed670f15 (diff)
downloadjustbuild-22ddf965548a648a577f732007b67b26036ce685.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/common/TARGETS1
-rw-r--r--src/buildtool/common/repository_config.hpp6
2 files changed, 5 insertions, 2 deletions
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<bool>(git_cas_);
}