From: Karthik Nayak Date: Tue, 06 Oct 2026 08:42:32 GMT Subject: Re: [PATCH 04/13] odb: refactor `odb_for_each_alternate()` to yield dirs Message-ID: In-Reply-To: <20261002-pks-odb-move-alternates-v1-4-8a63507b88c4@pks.im> Patrick Steinhardt writes: [snip] > @@ -468,9 +470,11 @@ static int refs_from_alternate_cb(struct odb_source *alternate, > void odb_for_each_alternate_ref(struct object_database *odb, > odb_for_each_alternate_ref_fn cb, void *payload) > { > - struct alternate_refs_data data; > - data.fn = cb; > - data.payload = payload; > + struct alternate_refs_data data = { > + .fn = cb, > + .payload = payload, > + .repo = odb->repo, > + }; > odb_for_each_alternate(odb, refs_from_alternate_cb, &data); > } > > @@ -481,7 +485,7 @@ int odb_for_each_alternate(struct object_database *odb, > int r = 0; > > for (alternate = odb->sources->next; alternate; alternate = alternate->next) { > - r = cb(alternate, payload); > + r = cb(odb_source_files_downcast(alternate)->dirs, payload); > if (r) > break; > } > Okay, so here we call the callbacks with the `dirs` now and this corresponds with the changes in the rest of the patch. Makes sense. [snip]