Commit 4e01e3029b389dc45a040b794ceeeb0cbe32004a

wilke 2013-09-13T21:21:33

Prevent git_tree_walk 'skip entry' callback return code from leaking through as the return value of git_tree_walk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/tree.c b/src/tree.c
index f946919..cd8adfb 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -881,8 +881,10 @@ static int tree_walk(
 	git_vector_foreach(&tree->entries, i, entry) {
 		if (preorder) {
 			error = callback(path->ptr, entry, payload);
-			if (error > 0)
+			if (error > 0) {
+				error = 0;
 				continue;
+			}
 			if (error < 0) {
 				giterr_clear();
 				return GIT_EUSER;