Skip to content

Commit c7cd0e3

Browse files
peffgitster
authored andcommitted
tree-walk: rename "error" variable
The "error" variable in traverse_trees() shadows the global error() function (meaning we can't call error() from here). Let's call the local variable "ret" instead, which matches the idiom in other functions. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent acd13d1 commit c7cd0e3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tree-walk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ int traverse_trees(struct index_state *istate,
441441
int n, struct tree_desc *t,
442442
struct traverse_info *info)
443443
{
444-
int error = 0;
444+
int ret = 0;
445445
struct name_entry *entry;
446446
int i;
447447
struct tree_desc_x *tx;
@@ -539,7 +539,7 @@ int traverse_trees(struct index_state *istate,
539539
if (interesting) {
540540
trees_used = info->fn(n, mask, dirmask, entry, info);
541541
if (trees_used < 0) {
542-
error = trees_used;
542+
ret = trees_used;
543543
if (!info->show_all_errors)
544544
break;
545545
}
@@ -558,7 +558,7 @@ int traverse_trees(struct index_state *istate,
558558
strbuf_release(&base);
559559

560560
traverse_trees_cur_depth--;
561-
return error;
561+
return ret;
562562
}
563563

564564
struct dir_state {

0 commit comments

Comments
 (0)