summaryrefslogtreecommitdiff
path: root/include/git2/tree.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-08-13 14:07:47 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2012-08-13 14:07:47 +0200
commita6bf16878a121152f5bddf4d46f641e8f044d278 (patch)
tree985236fd9f726695ea9591415c89594283290793 /include/git2/tree.h
parent53ae12359d324890c4d30cc06bd2631ebdec43bb (diff)
downloadlibgit2-a6bf16878a121152f5bddf4d46f641e8f044d278.tar.gz
tree: allow the user to skip an entry or cancel the walk
Returning a negative cancels the walk, and returning a positive one causes us to skip an entry, which was previously done by a negative value. This allows us to stay consistent with the rest of the functions that take a callback and keeps the skipping functionality.
Diffstat (limited to 'include/git2/tree.h')
-rw-r--r--include/git2/tree.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h
index b9134062..85407d7a 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -351,8 +351,9 @@ enum git_treewalk_mode {
* the current (relative) root for the entry and the entry
* data itself.
*
- * If the callback returns a negative value, the passed entry
- * will be skipped on the traversal.
+ * 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.
*
* @param tree The tree to walk
* @param callback Function to call on each tree entry