sparse-checkout: pass use_stdin as a parameter instead of as a global
commit1530ff3553c197ae04b5d9363e2c2b1f7d4198e1
authorElijah Newren <newren@gmail.com>
Tue, 14 Dec 2021 04:09:03 +0000 (14 04:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Dec 2021 19:48:21 +0000 (15 11:48 -0800)
tree46494eb640d758e0c46cfc88682950e75ec74e49
parentabe6bb3905392d5eb6b01fa6e54d7e784e0522aa
sparse-checkout: pass use_stdin as a parameter instead of as a global

add_patterns_from_input() has relied on a global variable,
set_opts.use_stdin, which has been used by both the `set` and `add`
subcommands of sparse-checkout.  Once we introduce an
add_opts.use_stdin, the hardcoding of set_opts.use_stdin will be
incorrect.  Pass the value as function parameter instead to allow us to
make subsequent changes.

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