summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_tree.cpp
diff options
context:
space:
mode:
authorSascha Roloff <sascha.roloff@huawei.com>2022-07-08 10:13:29 +0200
committerSascha Roloff <sascha.roloff@huawei.com>2022-08-05 14:41:31 +0200
commitee56ad123c7d6eeec98c586df1976dfb6a624586 (patch)
tree47f85941321ef016badbb6ef16ebff35b653dba2 /src/buildtool/file_system/git_tree.cpp
parentbb2375008f69bf62d510ce862f1d4370fa130ef3 (diff)
downloadjustbuild-ee56ad123c7d6eeec98c586df1976dfb6a624586.tar.gz
Git tree can return its raw string data
Diffstat (limited to 'src/buildtool/file_system/git_tree.cpp')
-rw-r--r--src/buildtool/file_system/git_tree.cpp8
1 files changed, 8 insertions, 0 deletions
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<std::size_t> {
return std::nullopt;
}
+auto GitTree::RawData() const noexcept -> std::optional<std::string> {
+ return cas_->ReadObject(raw_id_);
+}
+
auto GitTreeEntry::Blob() const noexcept -> std::optional<std::string> {
if (not IsBlob()) {
return std::nullopt;
@@ -109,3 +113,7 @@ auto GitTreeEntry::Size() const noexcept -> std::optional<std::size_t> {
}
return std::nullopt;
}
+
+auto GitTreeEntry::RawData() const noexcept -> std::optional<std::string> {
+ return cas_->ReadObject(raw_id_);
+}