Skip to content

Commit ed87465

Browse files
apenwarrgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 78d553b commit ed87465

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ static struct strategy *get_strategy(const char *name)
106106
found = 1;
107107
if (!found)
108108
add_cmdname(&not_strategies, ent->name, ent->len);
109-
exclude_cmds(&main_cmds, &not_strategies);
110109
}
110+
exclude_cmds(&main_cmds, &not_strategies);
111111
}
112112
if (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) {
113113
fprintf(stderr, "Could not find merge strategy '%s'.\n", name);

0 commit comments

Comments
 (0)