]> git.ipfire.org Git - thirdparty/git.git/commit
packfile: disentangle return value of `packed_object_info()`
authorPatrick Steinhardt <ps@pks.im>
Mon, 12 Jan 2026 09:00:45 +0000 (10:00 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jan 2026 14:51:14 +0000 (06:51 -0800)
commit8908c303da91400e8d9643da6fc697a081ac7374
tree8872bb186a4827fa523f93c210349b86bafaa132
parent57c168dc3824f1aaad553f90f55fdc86b75de561
packfile: disentangle return value of `packed_object_info()`

The `packed_object_info()` function returns the type of the packed
object. While we use an `enum object_type` to store the return value,
this type is not to be confused with the actual object type. It _may_
contain the object type, but it may just as well encode that the given
packed object is stored as a delta.

We have removed the only caller that relied on this returned object type
in the preceding commit, so let's simplify semantics and return either 0
on success or a negative error code otherwise.

This unblocks a small optimization where we can skip reading the object
type altogether.

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