From: Avery Pennarun Date: Thu, 26 Nov 2009 02:23:54 +0000 (-0500) Subject: builtin-merge.c: call exclude_cmds() correctly. X-Git-Tag: v1.6.6-rc1~10^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ed87465658c83a5a1617920e7b605bd830a78aed;p=git-core%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin-merge.c b/builtin-merge.c index b6b84286b..4bcf7c7bc 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -106,8 +106,8 @@ static struct strategy *get_strategy(const char *name) found = 1; if (!found) add_cmdname(¬_strategies, ent->name, ent->len); - exclude_cmds(&main_cmds, ¬_strategies); } + exclude_cmds(&main_cmds, ¬_strategies); } if (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) { fprintf(stderr, "Could not find merge strategy '%s'.\n", name);