[PATCH 2/8] packfile: always declare object info to be OI_PACKED
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 18, 2025, 06:28 UTC
- Message-ID
- <20251218-b4-pks-odb-read-object-info-improvements-v1-2-81c8368492be@pks.im>
- In-Reply-To
- <20251218-b4-pks-odb-read-object-info-improvements-v1-0-81c8368492be@pks.im>
When reading object info via a packfile we yield one of two types:
- The object can either be OI_PACKED, which is what a caller would
typically expect.- Or it can be OI_DBCACHED if it is stored in the delta base cache.
The latter really is an implementation detail though, and callers typically don't care at all about the difference. Furthermore, the information whether or not it is part of the delta base cache can already be derived via the `is_delta` field, so the fact that we discern between OI_PACKED and OI_DBCACHED only further complicates the interface.
Drop the OI_DBCACHED enum completely. There don't seem to be any callers that care about the distinction.
Signed-off-by: Patrick Steinhardt <ps@pks.im> --- odb.h | 1 - packfile.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/odb.h b/odb.h index 014cd9585a..73b0b87ad5 100644 --- a/odb.h +++ b/odb.h @@ -330,7 +330,6 @@ struct object_info { OI_CACHED, OI_LOOSE, OI_PACKED, - OI_DBCACHED } whence; union { /* diff --git a/packfile.c b/packfile.c index c88bd92619..79ad9d7179 100644 --- a/packfile.c +++ b/packfile.c @@ -1656,8 +1656,7 @@ int packed_object_info(struct repository *r, struct packed_git *p, oidclr(oi->delta_base_oid, p->repo->hash_algo); } - oi->whence = in_delta_base_cache(p, obj_offset) ? OI_DBCACHED : - OI_PACKED; + oi->whence = OI_PACKED; out: unuse_pack(&w_curs);
-- 2.52.0.351.gbe84eed79e.dirty