Thread (85 messages) 85 messages, 4 authors, 10d ago

Re: [PATCH v2 05/17] odb/source-packed: start converting to a proper `struct odb_source`

From: Patrick Steinhardt <hidden>
Date: 2026-06-17 07:26:36

On Tue, Jun 16, 2026 at 04:36:59PM -0500, Justin Tobler wrote:
On 26/06/09 10:50AM, Patrick Steinhardt wrote:
quoted
 struct odb_source_packed *odb_source_packed_new(struct odb_source_files *parent)
 {
-	struct odb_source_packed *store;
-	CALLOC_ARRAY(store, 1);
-	store->files = parent;
-	strmap_init(&store->packs_by_path);
-	return store;
+	struct odb_source_packed *packed;
+
+	CALLOC_ARRAY(packed, 1);
+	odb_source_init(&packed->base, parent->base.odb, ODB_SOURCE_PACKED,
+			parent->base.path, parent->base.local);
+	packed->files = parent;
+	strmap_init(&packed->packs_by_path);
+
+	packed->base.free = odb_source_packed_free;
+
+	if (!is_absolute_path(parent->base.path))
+		chdir_notify_register(NULL, odb_source_packed_reparent, packed);
Out of curiousity, did the packfile store previously not have to worry
about changing directories?
No, it didn't, and at this step here it still doesn't. This is mostly
because we still use the path of the "files" source, and that source
handles the reparenting for us. But it will be needed in a subsequent
step once we get rid of the pointer to the owning "files" source.

Patrick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help