diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-11-08 12:42:32 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-11-14 14:23:05 +0100 |
commit | e89833e12fd374a107e7595d63c4b4f17a4c7496 (patch) | |
tree | 1e29401c3dda89c22f1c212f6f9277c6c0c76625 /src/buildtool/common/repository_config.hpp | |
parent | 0d80574a5bd6cfe21827a7e0da2ddc84773363a3 (diff) | |
download | justbuild-e89833e12fd374a107e7595d63c4b4f17a4c7496.tar.gz |
common: Implement IWYU suggestions
Diffstat (limited to 'src/buildtool/common/repository_config.hpp')
-rw-r--r-- | src/buildtool/common/repository_config.hpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/buildtool/common/repository_config.hpp b/src/buildtool/common/repository_config.hpp index 54440187..cffd4971 100644 --- a/src/buildtool/common/repository_config.hpp +++ b/src/buildtool/common/repository_config.hpp @@ -16,6 +16,7 @@ #define INCLUDED_SRC_BUILDTOOL_COMMON_REPOSITORY_CONFIG_HPP #include <filesystem> +#include <functional> #include <map> #include <memory> #include <optional> @@ -29,6 +30,7 @@ #include "src/buildtool/crypto/hash_function.hpp" #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/multithreading/atomic_value.hpp" #include "src/buildtool/storage/storage.hpp" @@ -172,9 +174,13 @@ class RepositoryConfig { [[nodiscard]] auto Get(std::string const& repo, std::function<T const*(RepositoryInfo const&)> const& getter) const noexcept -> T const* { - if (auto const* info = Info(repo)) { - return getter(*info); - } + try { + if (auto const* info = Info(repo)) { + return getter(*info); + } + } catch (...) { + return nullptr; + }; return nullptr; } |