Re: [PATCH 06/13] object-file: move loose object cache into loose source
On Fri, Oct 24, 2025 at 02:44:49PM -0700, Junio C Hamano wrote:
Show 21 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
>
> > @@ -2006,5 +2006,8 @@ struct odb_loose_source *odb_loose_source_new(struct odb_source *source)
> >
> > void odb_loose_source_free(struct odb_loose_source *source)
> > {
> > + if (!source)
> > + return;
> > + odb_clear_loose_cache(source->source);
> > free(source);
> > }
>
> This had me confused, especially the source->source part. Perhaps
> call the parameter "loose" so loose->source is the way for somebody
> who has a odb_loose_source to learn what odb_source it belongs to,
> or something. Of course the round-about way to clera the cache that
> now belongs to odb_loose_source by taking odb_source looked awkward
> in this step, but that awkwardness goes away immediately in the next
> step. And the parameter of type "odb_loose_source *" called "source"
> here, instead of "loose", still hurts after the next step [07/13] is
> applied.That's fair. Will rename accordingly, thanks!
Patrick