]> Kevux Git Server - rit/commit
pack-bitmap: deduplicate logic to iterate over preferred bitmap tips
authorPatrick Steinhardt <ps@pks.im>
Thu, 19 Feb 2026 07:57:49 +0000 (08:57 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 19 Feb 2026 18:41:18 +0000 (10:41 -0800)
commited693078e988adf66c969feb6de9f83c7abe7d24
treefb588e873c70c3d15b125d2f5e144e4e918cdb31
parentea717645d199f6f1b66058886475db3e8c9330e9
pack-bitmap: deduplicate logic to iterate over preferred bitmap tips

We have two locations that iterate over the preferred bitmap tips as
configured by the user via "pack.preferBitmapTips". Both of these
callsites are subtly wrong: when the preferred bitmap tips contain an
exact refname match, then we will hit a `BUG()`.

Prepare for the fix by unifying the two callsites into a new
`for_each_preferred_bitmap_tip()` function.

This removes the last callsite of `bitmap_preferred_tips()` outside of
"pack-bitmap.c". As such, convert the function to be local to that file
only. Note that the function is still used by a second caller, so we
cannot just inline it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
pack-bitmap.c
pack-bitmap.h
repack-midx.c