]> git.ipfire.org Git - thirdparty/git.git/commit
pack-redundant: delay creation of unique_objects
authorJiang Xin <zhiyou.jx@alibaba-inc.com>
Sat, 2 Feb 2019 13:30:13 +0000 (21:30 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Feb 2019 22:18:24 +0000 (14:18 -0800)
commit301117764041101ae228e8e33c12c0b232b06408
tree6287b7de285cd6a39f590e76ea41631065e9f054
parent3173a94d577e14501039e85f333e9c98cbd92667
pack-redundant: delay creation of unique_objects

Instead of initializing unique_objects in `add_pack()`, copy from
all_objects in `cmp_two_packs()`, when unwanted objects are removed from
all_objects.

This will save memory (no allocate memory for alt-odb packs), and run
`llist_sorted_difference_inplace()` only once when removing ignored
objects and removing objects in alt-odb in `scan_alt_odb_packs()`.

Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-redundant.c