On this page:
8.18
top
up

48TreeπŸ”— i

procedure

( git_tree_create_updated out
repo
baseline
nupdates
updates)integer?
out:oid?
repo:repository?
baseline:tree?
nupdates:integer?
updates:tree_update?
Create a tree based on another one with the specified modifications

Given the baseline perform the changes described in the list of updates and create a new tree.

This function is optimized for common file/directory addition, removal and replacement in trees. It is much more efficient than reading the tree into a git_index and modifying that, but in exchange it is not as flexible.

Deleting and adding the same entry is undefined behaviour, changing a tree to a blob or viceversa is not supported.

procedure

( git_tree_dupsource)tree?

source:tree?
Create an in-memory copy of a tree. The copy must be explicitly free’d or it will leak.

procedure

( git_tree_entry_byidtreeid)tree_entry?

tree:tree?
id:oid?
Lookup a tree entry by SHA value.

This returns a git_tree_entry that is owned by the git_tree. You don’t have to free it, but you must not use it after the git_tree is released.

Warning: this must examine every entry in the tree, so it is not fast.

procedure

( git_tree_entry_byindextreeidx)tree_entry?

tree:tree?
idx:integer?
Lookup a tree entry by its position in the tree

This returns a git_tree_entry that is owned by the git_tree. You don’t have to free it, but you must not use it after the git_tree is released.

procedure

( git_tree_entry_bynametreefilename)tree_entry?

tree:tree?
filename:string?
Lookup a tree entry by its filename

This returns a git_tree_entry that is owned by the git_tree. You don’t have to free it, but you must not use it after the git_tree is released.

procedure

( git_tree_entry_bypathrootpath)tree_entry?

root:tree?
path:string?
Retrieve a tree entry contained in a tree or in any of its subtrees, given its relative path.

Unlike the other lookup functions, the returned tree entry is owned by the user and must be freed explicitly with git_tree_entry_free().

procedure

( git_tree_entry_cmpe1e2)integer?

e1:tree_entry?
e2:tree_entry?
Compare two tree entries

procedure

( git_tree_entry_dupsource)tree_entry?

source:tree_entry?
Duplicate a tree entry

Create a copy of a tree entry. The returned copy is owned by the user, and must be freed explicitly with git_tree_entry_free().

procedure

( git_tree_entry_filemodeentry)git_filemode_t

entry:tree_entry?
Get the UNIX file attributes of a tree entry

procedure

( git_tree_entry_filemode_rawentry)git_filemode_t

entry:tree_entry?
Get the raw UNIX file attributes of a tree entry

This function does not perform any normalization and is only useful if you need to be able to recreate the original tree object.

procedure

( git_tree_entry_freeentry)void?

entry:tree_entry?
Free a user-owned tree entry

IMPORTANT: This function is only needed for tree entries owned by the user, such as the ones returned by git_tree_entry_dup() or git_tree_entry_bypath().

procedure

( git_tree_entry_identry)oid?

entry:tree_entry?
Get the id of the object pointed by the entry

procedure

( git_tree_entry_nameentry)string?

entry:tree_entry?
Get the filename of a tree entry

procedure

( git_tree_entry_to_objectrepoentry)object?

repo:repository?
entry:tree_entry?
Convert a tree entry to the git_object it points to.

You must call git_object_free() on the object when you are done with it.

procedure

( git_tree_entry_typeentry)git_otype

entry:tree_entry?
Get the type of the object pointed by the entry

procedure

( git_tree_entrycounttree)integer?

tree:tree?
Get the number of entries listed in a tree

procedure

( git_tree_freetree)void?

tree:tree?
Close an open tree

You can no longer use the git_tree pointer after this call.

IMPORTANT: You MUST call this method when you stop using a tree to release memory. Failure to do so will cause a memory leak.

procedure

( git_tree_idtree)oid?

tree:tree?
Get the id of a tree.

procedure

( git_tree_lookuprepoid)tree?

repo:repository?
id:oid?
Lookup a tree object from the repository.

procedure

( git_tree_lookup_prefixrepoidlen)tree?

repo:repository?
id:oid?
len:integer?
Lookup a tree object from the repository, given a prefix of its identifier (short id).

procedure

( git_tree_ownertree)repository?

tree:tree?
Get the repository that contains the tree.

procedure

( git_tree_walktreemodecallbackpayload)integer?

tree:tree?
mode:git_treewalk_mode
callback:git_treewalk_cb
payload:bytes?
Traverse the entries in a tree and its subtrees in post or pre order.

The entries will be traversed in the specified order, children subtrees will be automatically loaded as required, and the callback will be called once per entry with the current (relative) root for the entry and the entry data itself.

If the callback returns a positive value, the passed entry will be skipped on the traversal (in pre mode). A negative value stops the walk.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /