class Agate::TreeBuilder

Overview

Builds a new tree object entry by entry.

Defined in:

agate/tree.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(repo : Repository, source : Tree | Nil = nil) : TreeBuilder #

Creates a new tree builder, optionally based on an existing tree.


[View source]

Instance Method Detail

def <<(tuple : Tuple(String, OID, FileMode)) : Nil #

Alias for insert.


[View source]
def clear : Nil #

Clears all entries.


[View source]
def count : Int32 #

Returns the number of entries in the builder.


[View source]
def insert(name : String, oid : OID, filemode : FileMode = FileMode::Blob) : Nil #

Inserts or updates an entry.


[View source]
def remove(name : String) : Nil #

Removes an entry by name.


[View source]
def write : OID #

Writes the tree to the repository and returns its OID.


[View source]