odb: drop `whence` field from object info

In the preceding commits we have migrated all callers to derive their information of how a specific object is stored to use the new object info source instead, and hence the field is now unused. Drop it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Jul 2, 2026 at 14:02 UTC aea037e53444fd2ffebbd22b49726d9730ced389
5 files changed -14
odb.c
-1
@@ -691,7 +691,6 @@ static int oid_object_info_convert(struct repository *r,
691 return -1;
692 }
693 }
694 - input_oi->whence = new_oi.whence;
694 if (input_oi->source_infop)
695 *input_oi->source_infop = *new_oi.source_infop;
696 return ret;
odb.h
-7
@@ -311,13 +311,6 @@ struct object_info {
311 * or multiple times in the same source.
312 */
313 struct odb_source_info *source_infop;
314 -
315 - /* Response */
316 - enum {
317 - OI_CACHED,
318 - OI_LOOSE,
319 - OI_PACKED,
320 - } whence;
314 };
315
316 /*
odb/source-inmemory.c
-2
@@ -54,8 +54,6 @@ static void populate_object_info(struct odb_source_inmemory *source,
54 *oi->mtimep = 0;
55 if (oi->source_infop)
56 oi->source_infop->source = &source->base;
57 -
58 - oi->whence = OI_CACHED;
57 }
58
59 static int odb_source_inmemory_read_object_info(struct odb_source *source,
odb/source-loose.c
-2
@@ -198,8 +198,6 @@ out:
198 oidclr(oi->delta_base_oid, loose->base.odb->repo->hash_algo);
199 if (oi->source_infop && !ret)
200 oi->source_infop->source = &loose->base;
201 - if (!ret)
202 - oi->whence = OI_LOOSE;
201 }
202
203 return ret;
packfile.c
-2
@@ -1421,8 +1421,6 @@ int packed_object_info_with_index_pos(struct odb_source_packed *source,
1421 oidclr(oi->delta_base_oid, p->repo->hash_algo);
1422 }
1423
1424 - oi->whence = OI_PACKED;
1425 -
1424 if (oi->source_infop) {
1425 if (!source)
1426 BUG("cannot request source without an owning source");