diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-07-11 10:54:57 +0200 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2022-08-05 14:41:31 +0200 |
commit | a3064e549eb666c162c5bd333a17598355620d63 (patch) | |
tree | 8189b23dc7c9e33c83f764ff199076b692f79bda /src/buildtool/file_system/git_cas.hpp | |
parent | fc78fc779889a8b7e8041f518d6ec4184f4b29e5 (diff) | |
download | justbuild-a3064e549eb666c162c5bd333a17598355620d63.tar.gz |
GitCAS: Add create tree via libgit2's treebuilder
Diffstat (limited to 'src/buildtool/file_system/git_cas.hpp')
-rw-r--r-- | src/buildtool/file_system/git_cas.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/buildtool/file_system/git_cas.hpp b/src/buildtool/file_system/git_cas.hpp index 051e40f1..df077daf 100644 --- a/src/buildtool/file_system/git_cas.hpp +++ b/src/buildtool/file_system/git_cas.hpp @@ -77,6 +77,16 @@ class GitCAS { bool is_hex_id = false) const noexcept -> std::optional<tree_entries_t>; + /// \brief Create a flat tree from entries and store tree in CAS. + /// Creating a tree must be backed by an object database. Therefore, a valid + /// instance of this class is required. Furthermore, all entries must be + /// available in the underlying object database and object types must + /// correctly reflect the type of the object found in the database. + /// \param entries The entries to create the tree from. + /// \returns The raw object id as string, if successful. + [[nodiscard]] auto CreateTree(GitCAS::tree_entries_t const& entries) + const noexcept -> std::optional<std::string>; + private: git_odb* odb_{nullptr}; bool initialized_{false}; |