diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2017-06-09 20:17:30 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-12 13:39:43 -0700 |
commit | 9ada7aee198c3644604eac1ff7cc50284b48d85f (patch) | |
tree | 1e3c317466555b5e75a77fe3d766b98731f32362 | |
parent | e35b6ac56f6582f85319ebc86d4a9b42ca5a21cb (diff) | |
download | git-9ada7aee198c3644604eac1ff7cc50284b48d85f.tar.gz git-9ada7aee198c3644604eac1ff7cc50284b48d85f.tar.xz |
revision.c: stricter parsing of '--no-{min,max}-parents'
These two options are parsed using starts_with(), allowing things like
'git log --no-min-parents-foobarbaz' to succeed.
Use strcmp() instead.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | revision.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/revision.c b/revision.c index b37dbec37..8a40cc7b3 100644 --- a/revision.c +++ b/revision.c @@ -1777,11 +1777,11 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->max_parents = 1; } else if (starts_with(arg, "--min-parents=")) { revs->min_parents = atoi(arg+14); - } else if (starts_with(arg, "--no-min-parents")) { + } else if (!strcmp(arg, "--no-min-parents")) { revs->min_parents = 0; } else if (starts_with(arg, "--max-parents=")) { revs->max_parents = atoi(arg+14); - } else if (starts_with(arg, "--no-max-parents")) { + } else if (!strcmp(arg, "--no-max-parents")) { revs->max_parents = -1; } else if (!strcmp(arg, "--boundary")) { revs->boundary = 1; |