diff options
Diffstat (limited to 'src/buildtool/file_system/git_repo.hpp')
-rw-r--r-- | src/buildtool/file_system/git_repo.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/buildtool/file_system/git_repo.hpp b/src/buildtool/file_system/git_repo.hpp index a5a8da7a..eba826d9 100644 --- a/src/buildtool/file_system/git_repo.hpp +++ b/src/buildtool/file_system/git_repo.hpp @@ -186,6 +186,15 @@ class GitRepo { anon_logger_ptr const& logger) noexcept -> std::optional<std::filesystem::path>; + /// \brief Check if given tree ID is present in the directory structure of + /// the local repository. + /// Calling it from a fake repository allows thread-safe use. + /// Returns a status of tree presence, or nullopt if failure. + /// It guarantees the logger is called exactly once with fatal if failure. + [[nodiscard]] auto CheckTreeExists(std::string const& tree_id, + anon_logger_ptr const& logger) noexcept + -> std::optional<bool>; + private: // IMPORTANT! The GitCAS object must be defined before the repo object to // keep the GitContext alive until cleanup ends. |