builtin-merge.c: call exclude_cmds() correctly.
We need to call exclude_cmds() after the loop, not during the loop, because excluding a command from the array can change the indexes of objects in the array. The result is that, depending on file ordering, some commands weren't excluded as they should have been. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Avery Pennarun committed
Nov 25, 2009 at 21:23 UTC
ed87465658c83a5a1617920e7b605bd830a78aed
1 file changed
+1
-1
builtin-merge.c
+1
-1
@@ -106,8 +106,8 @@ static struct strategy *get_strategy(const char *name)
106
found = 1;
107
if (!found)
108
add_cmdname(¬_strategies, ent->name, ent->len);
109
- exclude_cmds(&main_cmds, ¬_strategies);
109
}
110
+ exclude_cmds(&main_cmds, ¬_strategies);
111
}
112
if (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) {
113
fprintf(stderr, "Could not find merge strategy '%s'.\n", name);