Re: [PATCH 1/7] loose: drop unused `repo_write_loose_object_map()`
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Oct 19, 2026, 20:21 UTC
- Message-ID
- <CAOLa=ZT91C0OZE=h7B0j6mgPhfrGjkRN4bCT9gVEXdXx+bSi1A@mail.gmail.com>
- In-Reply-To
- <20261019-b4-pks-odb-extension-v1-1-143a5963b77f@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 15 quoted lines
> The function `repo_write_loose_object_map()` was introduced in > 23b2c7e95b (loose: add a mapping between SHA-1 and SHA-256 for loose > objects, 2023-10-01), but it never had any callers as loose object maps > are instead written incrementally via `repo_add_loose_object_map()` > whenever a new loose object is created. > > Besides being dead code, the function also hardcodes the location of the > "loose-object-idx" file as "$GIT_COMMON_DIR/objects", whereas both the > reader and `repo_add_loose_object_map()` derive the location from the > loose source's path. The function would thus disagree with everyone else > where the loose object map is supposed to be located when the object > directory is using a non-default location. > > Remove the function. >
It's like the function being unused is an insufficient argument by itself, so we also talk about why its incorrect. Made me chuckle.
The patch obviously makes sense.
[snip]