Skip to content

Commit 11e934d

Browse files
peffdscho
authored andcommitted
fast-import: tighten parsing of boolean command line options
We parse options like "--max-pack-size=" using skip_prefix(), which makes sense to get at the bytes after the "=". However, we also parse "--quiet" and "--stats" with skip_prefix(), which allows things like "--quiet-nonsense" to behave like "--quiet". This was a mistaken conversion in 0f6927c (fast-import: put option parsing code in separate functions, 2009-12-04). Let's tighten this to an exact match, which was the original intent. Signed-off-by: Jeff King <[email protected]>
1 parent 816f806 commit 11e934d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fast-import.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3312,9 +3312,9 @@ static int parse_one_option(const char *option)
33123312
option_active_branches(option);
33133313
} else if (skip_prefix(option, "export-pack-edges=", &option)) {
33143314
option_export_pack_edges(option);
3315-
} else if (starts_with(option, "quiet")) {
3315+
} else if (!strcmp(option, "quiet")) {
33163316
show_stats = 0;
3317-
} else if (starts_with(option, "stats")) {
3317+
} else if (!strcmp(option, "stats")) {
33183318
show_stats = 1;
33193319
} else {
33203320
return 0;

0 commit comments

Comments
 (0)