sparse-checkout: correct reapply's handling of options
commitf748012e01109d04d3e956e26557a7fb4f92ce47
authorElijah Newren <newren@gmail.com>
Sat, 19 Feb 2022 16:44:41 +0000 (19 16:44 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 20 Feb 2022 08:01:15 +0000 (20 00:01 -0800)
tree644823ced03b34a8ca9c747a3278a33a18285d5d
parentb80121027d1247a0754b3cc46897fee75c050b44
sparse-checkout: correct reapply's handling of options

Commit 4e256731d6 ("sparse-checkout: enable reapply to take
--[no-]{cone,sparse-index}", 2021-12-14) made it so that reapply could
take additional options but added no tests.  Tests would have shown that
the feature doesn't work because the initial values are set AFTER
parsing the command line options instead of before.  Add a test and set
the initial value at the appropriate time.

Reviewed-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/sparse-checkout.c
t/t1091-sparse-checkout-builtin.sh