summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_cas.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/file_system/git_cas.hpp')
-rw-r--r--src/buildtool/file_system/git_cas.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/buildtool/file_system/git_cas.hpp b/src/buildtool/file_system/git_cas.hpp
index 10a43111..5d200661 100644
--- a/src/buildtool/file_system/git_cas.hpp
+++ b/src/buildtool/file_system/git_cas.hpp
@@ -51,6 +51,11 @@ class GitCAS {
return odb_.get();
}
+ [[nodiscard]] auto GetRepository() const noexcept
+ -> gsl::not_null<git_repository*> {
+ return repo_.get();
+ }
+
/// \brief Read object from CAS.
/// \param id The object id.
/// \param is_hex_id Specify whether `id` is hex string or raw.
@@ -69,6 +74,9 @@ class GitCAS {
private:
std::unique_ptr<git_odb, decltype(&odb_closer)> odb_{nullptr, odb_closer};
+ std::unique_ptr<git_repository, decltype(&repository_closer)> repo_{
+ nullptr,
+ repository_closer};
// git folder path of repo
std::filesystem::path git_path_;