From: Patrick Steinhardt Date: Wed, 24 Jun 2026 12:19:18 +0000 (+0200) Subject: odb: drop `whence` field from object info X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3bae0b86d1efe8c5dfdb5b6feb261762efa58fa;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/odb.c b/odb.c index 99f4e7551c..82c41f1793 100644 --- a/odb.c +++ b/odb.c @@ -691,7 +691,6 @@ static int oid_object_info_convert(struct repository *r, return -1; } } - input_oi->whence = new_oi.whence; if (input_oi->sourcep) *input_oi->sourcep = *new_oi.sourcep; return ret; diff --git a/odb.h b/odb.h index 330a55879e..e0d05eaf87 100644 --- a/odb.h +++ b/odb.h @@ -311,13 +311,6 @@ struct object_info { * or multiple times in the same source. */ struct object_info_source *sourcep; - - /* Response */ - enum { - OI_CACHED, - OI_LOOSE, - OI_PACKED, - } whence; }; /* diff --git a/odb/source-inmemory.c b/odb/source-inmemory.c index 2328e62687..008e49bfe9 100644 --- a/odb/source-inmemory.c +++ b/odb/source-inmemory.c @@ -54,8 +54,6 @@ static void populate_object_info(struct odb_source_inmemory *source, *oi->mtimep = 0; if (oi->sourcep) oi->sourcep->source = &source->base; - - oi->whence = OI_CACHED; } static int odb_source_inmemory_read_object_info(struct odb_source *source, diff --git a/odb/source-loose.c b/odb/source-loose.c index 5c4e9892b5..e743ccab42 100644 --- a/odb/source-loose.c +++ b/odb/source-loose.c @@ -198,8 +198,6 @@ out: oidclr(oi->delta_base_oid, loose->base.odb->repo->hash_algo); if (oi->sourcep && !ret) oi->sourcep->source = &loose->base; - if (!ret) - oi->whence = OI_LOOSE; } return ret; diff --git a/packfile.c b/packfile.c index fa22095b75..4a8c108034 100644 --- a/packfile.c +++ b/packfile.c @@ -1421,8 +1421,6 @@ int packed_object_info_with_index_pos(struct odb_source_packed *source, oidclr(oi->delta_base_oid, p->repo->hash_algo); } - oi->whence = OI_PACKED; - if (oi->sourcep) { if (!source) BUG("cannot request source without an owning source");