]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sparse-checkout: disallow --no-stdin as an argument to set
authorElijah Newren <newren@gmail.com>
Tue, 14 Dec 2021 04:09:06 +0000 (04:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Dec 2021 19:48:21 +0000 (11:48 -0800)
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 <vdye@github.com>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/sparse-checkout.c

index eb8fbd36b0bb837ee543a15ecee9b01a2ac61a24..387903eafe755b15f3549a40b0a0cca96a5646cf 100644 (file)
@@ -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(),
        };