]> git.ipfire.org Git - thirdparty/git.git/commit
sparse-index: silently return when not using cone-mode patterns
authorDerrick Stolee <dstolee@microsoft.com>
Wed, 8 Sep 2021 01:42:26 +0000 (01:42 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Sep 2021 05:41:09 +0000 (22:41 -0700)
commite27eab45c758bf194157b819fae4fd0fcce498fb
tree607945e29c7a1c69d288b8487fee8ad277dae175
parent522d3cec0089228d0b1a5178c396662953cb2dc2
sparse-index: silently return when not using cone-mode patterns

While the sparse-index is only enabled when core.sparseCheckoutCone is
also enabled, it is possible for the user to modify the sparse-checkout
file manually in a way that does not match cone-mode patterns. In this
case, we should refuse to convert an index into a sparse index, since
the sparse_checkout_patterns will not be initialized with recursive and
parent path hashsets.

Also silently return if there are no cache entries, which is a simple
case: there are no paths to make sparse!

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sparse-index.c