Thread (26 messages) 26 messages, 3 authors, 2d ago
WARM2d

[PATCH v2 5/6] odb: drop `whence` field from object info

From: Patrick Steinhardt <hidden>
Date: 2026-07-02 12:02:18
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 odb.c                 | 1 -
 odb.h                 | 7 -------
 odb/source-inmemory.c | 2 --
 odb/source-loose.c    | 2 --
 packfile.c            | 2 --
 5 files changed, 14 deletions(-)
diff --git a/odb.c b/odb.c
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;
diff --git a/odb.h b/odb.h
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;
 };
 
 /*
diff --git a/odb/source-inmemory.c b/odb/source-inmemory.c
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,
diff --git a/odb/source-loose.c b/odb/source-loose.c
index c254957602..54df2e57d3 100644
--- a/odb/source-loose.c
+++ b/odb/source-loose.c
@@ -198,8 +198,6 @@ static int read_object_info_from_path(struct odb_source_loose *loose,
 			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;
diff --git a/packfile.c b/packfile.c
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");
-- 
2.55.0.795.g602f6c329a.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help