From: Diane <diane.gasselin@xxxxxxxxxxxxxxx> When an error is detected, traverse_trees() is not stopped anymore. The whole tree is traversed so that all the merging errors can be detected. Signed-off-by: Diane Gasselin <diane.gasselin@xxxxxxxxxxxxxxx> Signed-off-by: Axel Bonnet <axel.bonnet@xxxxxxxxxxxxxxx> Signed-off-by: Clément Poulain <clement.poulain@xxxxxxxxxxxxxxx> --- tree-walk.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tree-walk.c b/tree-walk.c index 67a9a0c..04072aa 100644 --- a/tree-walk.c +++ b/tree-walk.c @@ -310,6 +310,7 @@ static void free_extended_entry(struct tree_desc_x *t) 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; struct tree_desc_x *tx = xcalloc(n, sizeof(*tx)); @@ -378,7 +379,7 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info) break; ret = info->fn(n, mask, dirmask, entry, info); if (ret < 0) - break; + error = ret; mask &= ret; ret = 0; for (i = 0; i < n; i++) @@ -389,7 +390,7 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info) for (i = 0; i < n; i++) free_extended_entry(tx + i); free(tx); - return ret; + return error; } static int find_tree_entry(struct tree_desc *t, const char *name, unsigned char *result, unsigned *mode) -- 1.6.6.7.ga5fe3 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html