Re: [Outreachy PATCH v2] range-diff: use diffopt->repo instead of the_repository
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 29, 2026, 16:19 UTC
- Message-ID
- <xmqqzevw4gze.fsf@gitster.g>
- In-Reply-To
- <20261029084720.93221-1-okhuomonajayi54@gmail.com>
Okhuomon Ajayi <okhuomonajayi54@gmail.com> writes:
Show 21 quoted lines
> output_pair_header() and patch_diff() receive a diffopt whose repo > field names the repository to work on, yet they abbreviate object > names and look up commits in the_repository. get_filespec(), called > from patch_diff(), also uses the_hash_algo, which is the hash > algorithm of the_repository. If a caller set up diffopt for another > repository, these functions would still read from the global one. > > Use diffopt->repo in output_pair_header(), and add a hash algorithm > parameter to get_filespec() so that patch_diff() can pass > diffopt->repo->hash_algo. > > Keep USE_THE_REPOSITORY_VARIABLE because read_patches(), output() and > is_range_diff_range() still use the_repository. > > Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com> > --- > Changes since v1: > - Reworded the commit message as suggested by Pablo. No code was > changed. > > Thanks, Pablo, for the review.
OK, well written. Except for the "In-reply-to:" header that should point at your earlier iteration of the patch (not a review message your earlier iteration received), everything I see here looks good.
Will queue.