diff options
Diffstat (limited to 'src/buildtool/file_system/git_cas.hpp')
-rw-r--r-- | src/buildtool/file_system/git_cas.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/buildtool/file_system/git_cas.hpp b/src/buildtool/file_system/git_cas.hpp index 78cb6d0c..f358e65b 100644 --- a/src/buildtool/file_system/git_cas.hpp +++ b/src/buildtool/file_system/git_cas.hpp @@ -24,6 +24,7 @@ #include <utility> #include <vector> +#include "gsl/gsl" #include "src/buildtool/file_system/git_context.hpp" #include "src/buildtool/file_system/git_utils.hpp" @@ -36,6 +37,8 @@ class GitCAS { [[nodiscard]] static auto Open( std::filesystem::path const& repo_path) noexcept -> GitCASPtr; + [[nodiscard]] static auto CreateEmpty() noexcept -> GitCASPtr; + GitCAS() noexcept; ~GitCAS() noexcept = default; @@ -45,6 +48,10 @@ class GitCAS { auto operator=(GitCAS const&) = delete; auto operator=(GitCAS&& other) = delete; + [[nodiscard]] auto GetODB() const noexcept -> gsl::not_null<git_odb*> { + return odb_.get(); + } + /// \brief Read object from CAS. /// \param id The object id. /// \param is_hex_id Specify whether `id` is hex string or raw. |