From e89833e12fd374a107e7595d63c4b4f17a4c7496 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 8 Nov 2024 12:42:32 +0100 Subject: common: Implement IWYU suggestions --- src/buildtool/common/repository_config.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/buildtool/common/repository_config.hpp') 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 +#include #include #include #include @@ -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 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; } -- cgit v1.2.3