Xgit v0.8.0 Xgit.Tree View Source
Represents a git tree object in memory.
Link to this section Summary
Types
Error response codes returned by from_object/1.
This struct describes a single tree object so it can be manipulated in memory.
Functions
Renders a tree structure from an Xgit.Object.
Renders this tree structure into a corresponding Xgit.Object.
Return true if the value is a tree struct that is valid.
Link to this section Types
from_object_reason()
View Sourcefrom_object_reason() :: :not_a_tree | :invalid_format | :invalid_tree
Error response codes returned by from_object/1.
This struct describes a single tree object so it can be manipulated in memory.
Struct Members
:entries: list ofTree.Entrystructs, which must be sorted by name
Link to this section Functions
from_object(object)
View Sourcefrom_object(object :: Xgit.Object.t()) :: {:ok, tree :: t()} | {:error, from_object_reason()}
Renders a tree structure from an Xgit.Object.
Return Values
{:ok, tree} if the object contains a valid tree object.
{:error, :not_a_tree} if the object contains an object of a different type.
{:error, :invalid_format} if the object says that is of type tree, but
can not be parsed as such.
{:error, :invalid_tree} if the object can be parsed as a tree, but the
entries are not well formed or not properly sorted.
Renders this tree structure into a corresponding Xgit.Object.
Return true if the value is a tree struct that is valid.
All of the following must be true for this to occur:
- The value is a
Treestruct. - The entries are properly sorted.
- All entries are valid, as determined by
Xgit.Tree.Entry.valid?/1.