From: Elijah Newren Date: Tue, 14 Dec 2021 04:09:06 +0000 (+0000) Subject: sparse-checkout: disallow --no-stdin as an argument to set X-Git-Tag: v2.35.0-rc0~45^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f85751a147996f7f0a8edf3ea2a00217c9ddfc99;p=thirdparty%2Fgit.git sparse-checkout: disallow --no-stdin as an argument to set We intentionally added --stdin as an option to `sparse-checkout set`, but didn't intend for --no-stdin to be permitted as well. Reported-by: Victoria Dye Reviewed-by: Derrick Stolee Reviewed-by: Victoria Dye Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index eb8fbd36b0..387903eafe 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -699,8 +699,9 @@ static struct sparse_checkout_set_opts { static int sparse_checkout_set(int argc, const char **argv, const char *prefix) { static struct option builtin_sparse_checkout_set_options[] = { - OPT_BOOL(0, "stdin", &set_opts.use_stdin, - N_("read patterns from standard in")), + OPT_BOOL_F(0, "stdin", &set_opts.use_stdin, + N_("read patterns from standard in"), + PARSE_OPT_NONEG), OPT_END(), };