summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-08-29 15:25:45 (GMT)
committerJohannes Schindelin <johannes.schindelin@gmx.de>2019-12-04 12:20:04 (GMT)
commit11e934d56e46875b24d8a047d44b45ff243f6715 (patch)
tree2e5e57ac730e9a0e75ec8b749a5151214ba04208
parent816f806786e12435163c591942a204c5a3bdd795 (diff)
downloadgit-11e934d56e46875b24d8a047d44b45ff243f6715.zip
git-11e934d56e46875b24d8a047d44b45ff243f6715.tar.gz
git-11e934d56e46875b24d8a047d44b45ff243f6715.tar.bz2
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 0f6927c229 (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 <peff@peff.net>
-rw-r--r--fast-import.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fast-import.c b/fast-import.c
index 32ac532..1d0a06c 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -3312,9 +3312,9 @@ static int parse_one_option(const char *option)
option_active_branches(option);
} else if (skip_prefix(option, "export-pack-edges=", &option)) {
option_export_pack_edges(option);
- } else if (starts_with(option, "quiet")) {
+ } else if (!strcmp(option, "quiet")) {
show_stats = 0;
- } else if (starts_with(option, "stats")) {
+ } else if (!strcmp(option, "stats")) {
show_stats = 1;
} else {
return 0;