]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/index-pack.c
index-pack: calculate {ref,ofs}_{first,last} early
authorJonathan Tan <jonathantanmy@google.com>
Mon, 24 Aug 2020 19:16:36 +0000 (12:16 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Aug 2020 21:12:58 +0000 (14:12 -0700)
commitb4718cae51f9630f2901c452ca4e4dfbf68f47ef
tree63770b43d6a8008f144cbb99ef8b1d540e4b76ef
parenta7f7e84a496d194ceeeba9827d17c4c206932d2b
index-pack: calculate {ref,ofs}_{first,last} early

This is refactoring 2 of 2 to simplify struct base_data.

Whenever we make a struct base_data, immediately calculate its delta
children. This eliminates confusion as to when the
{ref,ofs}_{first,last} fields are initialized.

Before this patch, the delta children were calculated at the last
possible moment. This allowed the members of struct base_data to be
populated in any order, superficially useful when we have the object
contents before the struct object_entry. But this makes reasoning about
the state of struct base_data more complicated, hence this patch.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/index-pack.c