Git.Tree
A Git Tree object.
A Tree object ties on or more Blob.t
objects into a directory structure. In addition, a tree object can refer to other tree objects, thus creating a directory hierarchy.
Type of entry. It describes the name name
, the type perm
and the reference to the node node
.
entry ~name perm node
is the entry to node
with the name name
and the mode perm
.
The equal function for entry
.
type 'hash t = private 'hash entry list
Type of tree is a list of file names and modes along with refs to the associated blob and/or tree objects.
v entries
ties all entries
into one tree object. It does not remove duplicate but re-order the given list such as:
Tree.digest (Tree.v [ { name= a; _ }; { name= b; _ }] ) ;;
- : hash = 8d14531846b95bfa3564b58ccfb7913a034323b8
Tree.digest (Tree.v [ { name= b; _ }; { name= a; _ }] ) ;;
- : hash = 8d14531846b95bfa3564b58ccfb7913a034323b8
add entry tree
returns a tree containing all elements of tree
, plus entry
. If entry
was already in tree
, tree
is unchanged.
remove ~name tree
returns a tree
containing all elements of tree
, except one with the name name
. If any entries of the given tree
don't have the name name
, tree
is returned unchanged.
val is_empty : 'hash t -> bool
is_empty tree
tests whether the given tree
is empty or not.
val hashes : 'hash t -> 'hash list
hashes tree
returns the list of all node references of the given tree
.
to_list tree
returns the list of all entries of the given tree
.
iter f tree
applies f
in turn to all elements of s
.
module type S = sig ... end