summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tree.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tree.c b/src/tree.c
index 422e62b28..2e6153ba0 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -787,9 +787,10 @@ static int tree_walk(
for (i = 0; i < tree->entries.length; ++i) {
git_tree_entry *entry = tree->entries.contents[i];
- if (preorder &&
- (error = callback(path->ptr, entry, payload)) != 0)
+ if (preorder && callback(path->ptr, entry, payload)) {
+ error = GIT_EUSER;
break;
+ }
if (git_tree_entry__is_tree(entry)) {
git_tree *subtree;
@@ -814,9 +815,10 @@ static int tree_walk(
git_tree_free(subtree);
}
- if (!preorder &&
- (error = callback(path->ptr, entry, payload)) != 0)
+ if (!preorder && callback(path->ptr, entry, payload)) {
+ error = GIT_EUSER;
break;
+ }
}
return error;