Subject: Re: [PATCH v2 1/6] merge,diff: remove the_repository check before prefetching blobs

From: Patrick Steinhardt <[email-masked]>
Date: Fri, 20 Feb 2026 09:19:14 +0100

On Fri, Feb 20, 2026 at 01:59:43AM +0000, Elijah Newren via GitGitGadget wrote:
> diff --git a/diff.c b/diff.c
> index 35b903a9a0..91d81f66ad 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -7176,7 +7176,7 @@ void diffcore_std(struct diff_options *options)
>  	 * If no prefetching occurs, diffcore_rename() will prefetch if it
>  	 * decides that it needs inexact rename detection.
>  	 */
> -	if (options->repo == the_repository && repo_has_promisor_remote(the_repository) &&
> +	if (repo_has_promisor_remote(the_repository) &&

I wonder though -- shouldn't we also pass `options->repo` to
`repo_has_promisor_remote()` now? Otherwise we may support backfill
fetches from arbitrary repositories, but we'll only do them in case the
main repository has a promisor remote.

Patrick