Skip to content

Commit 53ded83

Browse files
committed
sparse-checkout: use default patterns for 'set' only !stdin
"git sparse-checkout set ---no-cone" uses default patterns when none is given from the command line, but it should do so ONLY when --stdin is not being used. Right now, add_patterns_from_input() called when reading from the standard input is sloppy and does not check if there are extra command line parameters that the command will silently ignore, but that will change soon and not setting this unnecessary and unused default patterns start to matter when it gets fixed. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 564d025 commit 53ded83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/sparse-checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ static int sparse_checkout_set(int argc, const char **argv, const char *prefix)
835835
* non-cone mode, if nothing is specified, manually select just the
836836
* top-level directory (much as 'init' would do).
837837
*/
838-
if (!core_sparse_checkout_cone && argc == 0) {
838+
if (!core_sparse_checkout_cone && !set_opts.use_stdin && argc == 0) {
839839
argv = default_patterns;
840840
argc = default_patterns_nr;
841841
} else {

0 commit comments

Comments
 (0)