Re: [Outreachy PATCH] merge-blobs: stop using the_repository
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 7, 2026, 02:30 UTC
- Message-ID
- <xmqqy0b59xvs.fsf@gitster.g>
- In-Reply-To
- <20261017105244.90295-1-okhuomonajayi54@gmail.com>
Okhuomon Ajayi <okhuomonajayi54@gmail.com> writes:
Show 10 quoted lines
> merge_blobs() already has the repository through istate. > Pass it to fill_mmfile_blob() and use it when reading objects. > > Remove the USE_THE_REPOSITORY_VARIABLE definition and > include the headers needed for the structure definitions. > > Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com> > --- > merge-blobs.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-)
Even though I would have introduced a single repo variable instead of dereferencing istate->repo number of times inside merge_blobs() function, that probably falls into personal preference category, so insignificant a difference that once code is written in one way, it is not worth going in and rewrite into the other way.
Let's mark the topic as ready for 'next'. Thanks.
Show 9 quoted lines
> - return odb_read_object(the_repository->objects, &our->object.oid, > + return odb_read_object(istate->repo->objects, &our->object.oid, > - if (fill_mmfile_blob(&f1, our) < 0) > + if (fill_mmfile_blob(istate->repo, &f1, our) < 0) > goto out_no_mmfile; > - if (fill_mmfile_blob(&f2, their) < 0) > + if (fill_mmfile_blob(istate->repo, &f2, their) < 0) > - if (fill_mmfile_blob(&common, base) < 0) > + if (fill_mmfile_blob(istate->repo, &common, base) < 0)