diff options
author | Russell Belfer <rb@github.com> | 2013-12-12 14:16:40 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-12-12 14:16:40 -0800 |
commit | 452c7de668568f75a97b0438daab9f33b68d605a (patch) | |
tree | 15c92dc3232cf138f509ed7f11a401b5966c68ea /include/git2/tree.h | |
parent | 9cfce2735d77f4d8b6005e62349dd97c0c6de5ab (diff) | |
download | libgit2-452c7de668568f75a97b0438daab9f33b68d605a.tar.gz |
Add git_treebuilder_insert test and clarify doc
This wasn't being tested and since it has a callback, I fixed it
even though the return value of this callback is not treated like
any of the other callbacks in the API.
Diffstat (limited to 'include/git2/tree.h')
-rw-r--r-- | include/git2/tree.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h index d94b446c2..422365674 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -332,11 +332,18 @@ GIT_EXTERN(int) git_treebuilder_insert( GIT_EXTERN(int) git_treebuilder_remove( git_treebuilder *bld, const char *filename); +/** + * Callback for git_treebuilder_filter + * + * The return value is treated as a boolean, with zero indicating that the + * entry should be left alone and any non-zero value meaning that the + * entry should be removed from the treebuilder list (i.e. filtered out). + */ typedef int (*git_treebuilder_filter_cb)( const git_tree_entry *entry, void *payload); /** - * Filter the entries in the tree + * Selectively remove entries in the tree * * 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 @@ -344,7 +351,7 @@ typedef int (*git_treebuilder_filter_cb)( * * @param bld Tree builder * @param filter Callback to filter entries - * @param payload Extra data to pass to filter + * @param payload Extra data to pass to filter callback */ GIT_EXTERN(void) git_treebuilder_filter( git_treebuilder *bld, |