2.52 Treebuilder
(require libgit2/include/treebuilder) | package: libgit2 |
procedure
(git_treebuilder_clear bld) → void?
bld : treebuilder?
procedure
(git_treebuilder_entrycount bld) → integer?
bld : treebuilder?
procedure
(git_treebuilder_filter bld filter payload) → integer?
bld : treebuilder? filter : git_treebuilder_filter_cb payload : bytes?
The filter callback will be called for each entry in the tree with a pointer to the entry and the provided payload; if the callback returns non-zero, the entry will be filtered (removed from the builder).
procedure
(git_treebuilder_free bld) → void?
bld : treebuilder?
This will clear all the entries and free to builder. Failing to free the builder after you’re done using it will result in a memory leak
procedure
bld : treebuilder? filename : string?
The returned entry is owned by the builder and should not be freed manually.
procedure
(git_treebuilder_insert bld filename id filemode) → tree_entry? bld : treebuilder? filename : string? id : oid? filemode : git_filemode_t
Insert a new entry for filename in the builder with the given attributes.
If an entry named filename already exists, its attributes will be updated with the given ones.
The optional pointer out can be used to retrieve a pointer to the newly created/updated entry. Pass NULL if you do not need it. The pointer may not be valid past the next operation in this builder. Duplicate the entry if you want to keep it.
No attempt is being made to ensure that the provided oid points to an existing git object in the object database, nor that the attributes make sense regarding the type of the pointed at object.
The tree builder can be used to create or modify trees in memory and write them as tree objects to the database.
If the source parameter is not NULL, the tree builder will be initialized with the entries of the given tree.
If the source parameter is NULL, the tree builder will start with no entries and will have to be filled manually.
procedure
(git_treebuilder_write id bld) → integer?
id : oid? bld : treebuilder?
The tree builder will be written to the given repo, and its identifying SHA1 hash will be stored in the id pointer.