]> Kevux Git Server - rit/commit
packfile: refactor `find_pack_entry()` to work on the packfile store
authorPatrick Steinhardt <ps@pks.im>
Fri, 9 Jan 2026 08:33:17 +0000 (09:33 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Jan 2026 14:40:07 +0000 (06:40 -0800)
commita593373b097322adc74aa5f9614c7650f87ebed9
treef18677a1b2d09d7adc531735f4447217bda704e2
parent6acefa0d2ca0fd95461b19026917d09210032b3d
packfile: refactor `find_pack_entry()` to work on the packfile store

The function `find_pack_entry()` doesn't work on a specific packfile
store, but instead works on the whole repository. This causes a bit of a
conceptual mismatch in its callers:

  - `packfile_store_freshen_object()` supposedly acts on a store, and
    its callers know to iterate through all sources already.

  - `packfile_store_read_object_info()` behaves likewise.

The only exception that doesn't know to handle iteration through sources
is `has_object_pack()`, but that function is trivial to adapt.

Refactor the code so that `find_pack_entry()` works on the packfile
store level instead.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
packfile.c