Skip to content

Commit

Permalink
builtin-merge.c: call exclude_cmds() correctly.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Avery Pennarun authored and Junio C Hamano committed Nov 30, 2009
1 parent 78d553b commit ed87465
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ static struct strategy *get_strategy(const char *name)
found = 1;
if (!found)
add_cmdname(&not_strategies, ent->name, ent->len);
exclude_cmds(&main_cmds, &not_strategies);
}
exclude_cmds(&main_cmds, &not_strategies);
}
if (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) {
fprintf(stderr, "Could not find merge strategy '%s'.\n", name);
Expand Down

0 comments on commit ed87465

Please sign in to comment.