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.hpp59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/buildtool/file_system/git_cas.hpp b/src/buildtool/file_system/git_cas.hpp
index 47592927..0d637c5e 100644
--- a/src/buildtool/file_system/git_cas.hpp
+++ b/src/buildtool/file_system/git_cas.hpp
@@ -34,25 +34,6 @@ using GitCASPtr = std::shared_ptr<GitCAS const>;
/// \brief Git CAS that maintains its Git context.
class GitCAS {
public:
- // Stores the data for defining a single Git tree entry, which consists of
- // a name (flat basename) and an object type (file/executable/tree).
- struct tree_entry_t {
- tree_entry_t(std::string n, ObjectType t)
- : name{std::move(n)}, type{t} {}
- std::string name;
- ObjectType type;
- [[nodiscard]] auto operator==(tree_entry_t const& other) const noexcept
- -> bool {
- return name == other.name and type == other.type;
- }
- };
-
- // Tree entries by raw id. The same id might refer to multiple entries.
- // Note that sharding by id is used as this format enables a more efficient
- // internal implementation for creating trees.
- using tree_entries_t =
- std::unordered_map<std::string, std::vector<tree_entry_t>>;
-
static auto Open(std::filesystem::path const& repo_path) noexcept
-> GitCASPtr;
@@ -83,46 +64,6 @@ class GitCAS {
bool is_hex_id = false) const noexcept
-> std::optional<std::pair<std::size_t, ObjectType>>;
- /// \brief Read entries from tree in CAS.
- /// Reading a tree must be backed by an object database. Therefore, a valid
- /// instance of this class is required.
- /// \param id The object id.
- /// \param is_hex_id Specify whether `id` is hex string or raw.
- [[nodiscard]] auto ReadTree(std::string const& id,
- 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>;
-
- /// \brief Read entries from tree data (without object db).
- /// \param data The tree object as plain data.
- /// \param id The object id.
- /// \param is_hex_id Specify whether `id` is hex string or raw.
- /// \returns The tree entries.
- [[nodiscard]] static auto ReadTreeData(std::string const& data,
- std::string const& id,
- bool is_hex_id = false) noexcept
- -> std::optional<tree_entries_t>;
-
- /// \brief Create a flat shallow (without objects in db) tree and return it.
- /// Creates a tree object from the entries without access to the actual
- /// blobs. Objects are not required to be available in the underlying object
- /// database. It is sufficient to provide the raw object id and and object
- /// type for every entry.
- /// \param entries The entries to create the tree from.
- /// \returns A pair of raw object id and the tree object content.
- [[nodiscard]] static auto CreateShallowTree(
- GitCAS::tree_entries_t const& entries) noexcept
- -> std::optional<std::pair<std::string, std::string>>;
-
private:
// IMPORTANT: the GitContext needs to be initialized before any git object!
GitContext git_context_{}; // maintains a Git context while CAS is alive