]> git.ipfire.org Git - thirdparty/git.git/commit
odb/source-loose: drop `odb_source_loose_has_object()`
authorPatrick Steinhardt <ps@pks.im>
Thu, 21 May 2026 08:22:31 +0000 (10:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 May 2026 13:35:19 +0000 (22:35 +0900)
commit3a54574b92b82187e83331d2be45f5f6db1e4c85
tree4409cff60e3563bacea8b0460ac7c5cd1e8b0d68
parent695bf6be948560acf18038c92bba5199d6e1109b
odb/source-loose: drop `odb_source_loose_has_object()`

The function `odb_source_loose_has_object()` checks whether a specific
object exists as a loose object on disk by using lstat(3p). This
interface is somewhat redundant, as we typically check for object
existence in a generic way via `odb_source_read_object_info()`.

In fact, these two calls are redundant in case the latter is called in a
specific way: when called without an object info request and without the
`OBJECT_INFO_QUICK` flag, then we will end up doing the same call to
lstat(3p) in `read_object_info_from_path()`.

Drop the function and adapt callers to instead use the generic
interface so that its calling conventions align with that of other
sources.

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