]> git.ipfire.org Git - thirdparty/git.git/commit
midx.c: extract `midx_fanout_add_pack_fanout()`
authorTaylor Blau <me@ttaylorr.com>
Mon, 22 Aug 2022 19:50:43 +0000 (15:50 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Aug 2022 20:04:22 +0000 (13:04 -0700)
commit1d6f4c64084f31bd1be558ae72f25e7600c39f4d
tree838d82b36c1dddc95403bbcba2d8d0d87e6d2bc1
parent852c530102c5ca5b69ae863acaa1acb50cbba861
midx.c: extract `midx_fanout_add_pack_fanout()`

Extract a routine to add all objects whose object ID's first byte is
`cur_fanout` from a given pack (identified by its index into the `struct
pack_info` array maintained by the MIDX writing routine).

Unlike the previous extraction (for `midx_fanout_add_midx_fanout()`),
this function will be called twice, once for all new packs, and again
for the preferred pack (if it appears in an existing MIDX). The latter
change is to resolve the bug described a few patches ago, and will be
made in the subsequent commit.

Similar to the previous refactoring, this function also enhances the
readability of its caller in `get_sorted_entries()`.

Its functionality is unchanged in this commit.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx.c