]> git.ipfire.org Git - thirdparty/git.git/commit
sparse-checkout: optimize string_list construction and add tests to verify deduplication.
authorAmisha Chhajed <amishhhaaaa@gmail.com>
Wed, 21 Jan 2026 13:00:05 +0000 (18:30 +0530)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Jan 2026 17:39:59 +0000 (09:39 -0800)
commit49223593fd743998d13fcd27fceaf1e0095bb08e
treef04ae04c44963a36bd2671aae8280a45d7dd22e0
parent9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed
sparse-checkout: optimize string_list construction and add tests to verify deduplication.

Improve O(n^2) complexity to O(n log n) while building a sorted
'string_list' by constructing it unsorted then sorting it
followed by removing duplicates.

sparse-checkout deduplicates repeated cone-mode patterns,
but this behaviour was previously untested, add tests that
verify that sparse-checkout file contain each cone
pattern only once and sparse-checkout list reports each pattern
only once.

Signed-off-by: Amisha Chhajed <amishhhaaaa@gmail.com>
Acked-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/sparse-checkout.c
t/t1091-sparse-checkout-builtin.sh