]> git.ipfire.org Git - thirdparty/git.git/commit
pack-redundant: consistent sort method
authorJiang Xin <zhiyou.jx@alibaba-inc.com>
Sat, 2 Feb 2019 13:30:17 +0000 (21:30 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Feb 2019 22:18:25 +0000 (14:18 -0800)
commit0e37abd2e89d475500e93a6368f1f054ca2fec55
tree5ef0d9ab7626daf784ab2d464e8e45d99fe85da2
parent4bc0cc12c19f00380052d0cfaf4e71e0a4630f41
pack-redundant: consistent sort method

SZEDER reported that test case t5323 has different test result on MacOS.
This is because `cmp_pack_list_reverse` cannot give identical result
when two pack being sorted has the same size of remaining_objects.

Changes to the sorting function will make consistent test result for
t5323.

The new algorithm to find redundant packs is a trade-off to save memory
resources, and the result of it may be different with old one, and may
be not the best result sometimes.  Update t5323 for the new algorithm.

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-redundant.c
t/t5323-pack-redundant.sh