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.hpp7
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 8751b1e6..10a43111 100644
--- a/src/buildtool/file_system/git_cas.hpp
+++ b/src/buildtool/file_system/git_cas.hpp
@@ -23,6 +23,7 @@
#include <string>
#include <utility>
+#include "gsl/gsl"
#include "src/buildtool/file_system/git_utils.hpp"
#include "src/buildtool/file_system/object_type.hpp"
@@ -35,6 +36,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;
@@ -44,6 +47,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.