diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-12-04 13:18:39 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-01-13 16:21:08 +0100 |
commit | d045a283e324d50dec41d70703aa33c3884a8891 (patch) | |
tree | 9d84c93bcdebca60a15580b9f958b2e281cf7e90 /src/buildtool/file_system/git_cas.hpp | |
parent | 98f1e8224753e7d7bfaf697012302887d85bff6c (diff) | |
download | justbuild-d045a283e324d50dec41d70703aa33c3884a8891.tar.gz |
GitCAS: retain git_repository alive.
(cherry-picked from 7b50ad08180edb160d023ed61518cd9256f65f70)
Diffstat (limited to 'src/buildtool/file_system/git_cas.hpp')
-rw-r--r-- | src/buildtool/file_system/git_cas.hpp | 8 |
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 f358e65b..78d03c99 100644 --- a/src/buildtool/file_system/git_cas.hpp +++ b/src/buildtool/file_system/git_cas.hpp @@ -52,6 +52,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. @@ -70,6 +75,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_; |