From d045a283e324d50dec41d70703aa33c3884a8891 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Wed, 4 Dec 2024 13:18:39 +0100 Subject: GitCAS: retain git_repository alive. (cherry-picked from 7b50ad08180edb160d023ed61518cd9256f65f70) --- src/buildtool/file_system/git_cas.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/buildtool/file_system/git_cas.hpp') 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 { + 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 odb_{nullptr, odb_closer}; + std::unique_ptr repo_{ + nullptr, + repository_closer}; // git folder path of repo std::filesystem::path git_path_; -- cgit v1.2.3