diff options
author | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-08-13 14:00:53 +0200 |
---|---|---|
committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-08-13 14:00:53 +0200 |
commit | 53ae12359d324890c4d30cc06bd2631ebdec43bb (patch) | |
tree | 55882ccd6f7c591c1a9a1c6bb8fbcb1b203df754 /src | |
parent | c9d78bde943213f4c2594d1df175336573678b74 (diff) | |
download | libgit2-53ae12359d324890c4d30cc06bd2631ebdec43bb.tar.gz |
tree: bring back the documented behaviour for a walk
However, there should be a way to cancel the walk and another to skip
the entry.
Diffstat (limited to 'src')
-rw-r--r-- | src/tree.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tree.c b/src/tree.c index e5858b50e..911cbadcf 100644 --- a/src/tree.c +++ b/src/tree.c @@ -787,10 +787,8 @@ static int tree_walk( for (i = 0; i < tree->entries.length; ++i) { git_tree_entry *entry = tree->entries.contents[i]; - if (preorder && callback(path->ptr, entry, payload)) { - error = GIT_EUSER; - break; - } + if (preorder && callback(path->ptr, entry, payload) < 0) + continue if (git_tree_entry__is_tree(entry)) { git_tree *subtree; |