aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-24 19:21:25 -0700
committerJunio C Hamano <gitster@pobox.com>2013-07-24 19:21:25 -0700
commitcb1824657bd0b6d9b916a0394cc67a6c18a27226 (patch)
tree19ad6a03775b950334fea8754081ae8a5abfe184
parent356df9bd8df58eb759fedaee8a8d1a7dc0872f8f (diff)
parenta04f8196a8f067b6c36415a0d934a46465140c34 (diff)
downloadgit-cb1824657bd0b6d9b916a0394cc67a6c18a27226.tar.gz
git-cb1824657bd0b6d9b916a0394cc67a6c18a27226.tar.xz
Merge branch 'sb/traverse-trees-bitmask-variable-name'
* sb/traverse-trees-bitmask-variable-name: traverse_trees(): clarify return value of the callback
-rw-r--r--tree-walk.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tree-walk.c b/tree-walk.c
index 6e30ef9d0..c62613523 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -323,7 +323,6 @@ static inline int prune_traversal(struct name_entry *e,
int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)
{
- int ret = 0;
int error = 0;
struct name_entry *entry = xmalloc(n*sizeof(*entry));
int i;
@@ -341,6 +340,7 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)
strbuf_setlen(&base, info->pathlen);
}
for (;;) {
+ int trees_used;
unsigned long mask, dirmask;
const char *first = NULL;
int first_len = 0;
@@ -404,15 +404,14 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)
if (interesting < 0)
break;
if (interesting) {
- ret = info->fn(n, mask, dirmask, entry, info);
- if (ret < 0) {
- error = ret;
+ trees_used = info->fn(n, mask, dirmask, entry, info);
+ if (trees_used < 0) {
+ error = trees_used;
if (!info->show_all_errors)
break;
}
- mask &= ret;
+ mask &= trees_used;
}
- ret = 0;
for (i = 0; i < n; i++)
if (mask & (1ul << i))
update_extended_entry(tx + i, entry + i);