]> git.ipfire.org Git - thirdparty/git.git/commit
sparse-checkout: disable sparse-index
authorDerrick Stolee <dstolee@microsoft.com>
Tue, 30 Mar 2021 13:11:01 +0000 (13:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Mar 2021 19:57:48 +0000 (12:57 -0700)
commitdcc5fd5fd26b71d75f9e70abd0e09e553b5f40ca
tree855943176b91bc07b3889f2bd9c1a01843f34164
parent122ba1f7b52612e197db76aded1f9681b80f3085
sparse-checkout: disable sparse-index

We use 'git sparse-checkout init --cone --sparse-index' to toggle the
sparse-index feature. It makes sense to also disable it when running
'git sparse-checkout disable'. This is particularly important because it
removes the extensions.sparseIndex config option, allowing other tools
to use this Git repository again.

This does mean that 'git sparse-checkout init' will not re-enable the
sparse-index feature, even if it was previously enabled.

While testing this feature, I noticed that the sparse-index was not
being written on the first run, but by a second. This was caught by the
call to 'test-tool read-cache --table'. This requires adjusting some
assignments to core_apply_sparse_checkout and pl.use_cone_patterns in
the sparse_checkout_init() logic.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/sparse-checkout.c
t/t1091-sparse-checkout-builtin.sh