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
index 34c35c47a5..175a1ee42c 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->source_infop)
*input_oi->source_infop = *new_oi.source_infop;
return ret;
odb.h
-7
index 659bf8afe1..c251788d50 100644
--- a/odb.h
+++ b/odb.h
@@ -311,13 +311,6 @@ struct object_info {
* or multiple times in the same source.
*/
struct odb_source_info *source_infop;
-
- /* Response */
- enum {
- OI_CACHED,
- OI_LOOSE,
- OI_PACKED,
- } whence;
};
/*
odb/source-inmemory.c
-2
index 1d173bfa46..460aec821c 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->source_infop)
oi->source_infop->source = &source->base;
-
- oi->whence = OI_CACHED;
}
static int odb_source_inmemory_read_object_info(struct odb_source *source,
odb/source-loose.c
-2
index c254957602..54df2e57d3 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->source_infop && !ret)
oi->source_infop->source = &loose->base;
- if (!ret)
- oi->whence = OI_LOOSE;
}
return ret;
packfile.c
-2
index ce51d1e5a3..8fa6309a09 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->source_infop) {
if (!source)
BUG("cannot request source without an owning source");