]> git.ipfire.org Git - thirdparty/git.git/commit
merge-ort: unconditionally release attributes index
authorPatrick Steinhardt <ps@pks.im>
Wed, 14 Aug 2024 06:52:33 +0000 (08:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Aug 2024 17:08:00 +0000 (10:08 -0700)
commitde54b450a3275e98858bf7e83475ad2465cce073
tree49168071c0f7392d4fdcf4bc22b47e4dad39bca5
parenta0b82622cbb31de66d7f5f0b1e39f349edaeb009
merge-ort: unconditionally release attributes index

We conditionally release the index used for reading gitattributes in
merge-ort based on whether or the index has been populated. This check
uses `cache_nr` as a condition. This isn't sufficient though, as the
variable may be zero even when some other parts of the index have been
populated. This leads to memory leaks when sparse checkouts are in use,
as we may not end up releasing the sparse checkout patterns.

Fix this issue by unconditionally releasing the index.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-ort.c
t/t3507-cherry-pick-conflict.sh
t/t6421-merge-partial-clone.sh
t/t6428-merge-conflicts-sparse.sh
t/t7817-grep-sparse-checkout.sh