git_tree_walk

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.

extern (C) nothrow @nogc
int
git_tree_walk

Parameters

tree const(libgit2_d.types.git_tree)*

The tree to walk

mode .git_treewalk_mode

Traversal mode (pre or post-order)

callback .git_treewalk_cb

Function to call on each tree entry

payload void*

Opaque pointer to be passed on each callback

Return Value

Type: int

0 or an error code

Meta