diff options
Diffstat (limited to 'src/buildtool/file_system/git_repo.hpp')
-rw-r--r-- | src/buildtool/file_system/git_repo.hpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/buildtool/file_system/git_repo.hpp b/src/buildtool/file_system/git_repo.hpp index 9c31f21b..05bcfaf3 100644 --- a/src/buildtool/file_system/git_repo.hpp +++ b/src/buildtool/file_system/git_repo.hpp @@ -234,12 +234,21 @@ class GitRepo { -> std::optional<bool>; /// \brief Check if given blob ID is present in the directory structure of - /// the local repository and try to return it. + /// the local repository. /// Calling it from a fake repository allows thread-safe use. - /// Returns a pair of a success flag, stating that no errors occurred while - /// performing the libgit2 calls, and an optional string containing the - /// content of the blob, if the blob is found. It guarantees the logger is - /// called exactly once with fatal if failure. + /// Returns a status of blob presence, or nullopt if failure. + /// It guarantees the logger is called exactly once with fatal if failure. + [[nodiscard]] auto CheckBlobExists(std::string const& blob_id, + anon_logger_ptr const& logger) noexcept + -> std::optional<bool>; + + /// \brief Check if given blob ID is present in the directory structure + /// of the local repository and try to return it. Calling it from a fake + /// repository allows thread-safe use. Returns a pair of a success flag, + /// stating that no errors occurred while performing the libgit2 calls, + /// and an optional string containing the content of the blob, if the + /// blob is found. It guarantees the logger is called exactly once with + /// fatal if failure. [[nodiscard]] auto TryReadBlob(std::string const& blob_id, anon_logger_ptr const& logger) noexcept -> std::pair<bool, std::optional<std::string>>; |