From ee56ad123c7d6eeec98c586df1976dfb6a624586 Mon Sep 17 00:00:00 2001 From: Sascha Roloff Date: Fri, 8 Jul 2022 10:13:29 +0200 Subject: Git tree can return its raw string data --- src/buildtool/file_system/git_tree.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/buildtool/file_system/git_tree.cpp') diff --git a/src/buildtool/file_system/git_tree.cpp b/src/buildtool/file_system/git_tree.cpp index 30c98261..d7a33f39 100644 --- a/src/buildtool/file_system/git_tree.cpp +++ b/src/buildtool/file_system/git_tree.cpp @@ -85,6 +85,10 @@ auto GitTree::Size() const noexcept -> std::optional { return std::nullopt; } +auto GitTree::RawData() const noexcept -> std::optional { + return cas_->ReadObject(raw_id_); +} + auto GitTreeEntry::Blob() const noexcept -> std::optional { if (not IsBlob()) { return std::nullopt; @@ -109,3 +113,7 @@ auto GitTreeEntry::Size() const noexcept -> std::optional { } return std::nullopt; } + +auto GitTreeEntry::RawData() const noexcept -> std::optional { + return cas_->ReadObject(raw_id_); +} -- cgit v1.2.3