Subject: Re: [PATCH 4/5] merge-ort: prevent the_repository from coming back

From: Junio C Hamano <[email-masked]>
Date: Thu, 19 Feb 2026 12:30:40 -0800

Elijah Newren <[email-masked]> writes:

> Yeah, also full disclosure: I do not know why
> prefetch_for_content_merges() needs to use the_repository.  When I
> introduced it back in 2bff554b23e8 (merge-ort: add prefetching for
> content merges, 2021-06-22), I was just looking at diffcore_std() and
> trying to mimic how it did the prefetch.  I don't actually understand
> why the comparison against the_repository is there for either of these
> functions.  Maybe someone else knows and could shed some light?  (cc:
> Jonathan Tan for the diffcore_std() case I was copying from...)

I did a bit of digging for you ;-)

The comparison with the_repository is from 7fbbcb21 (diff: batch
fetching of missing blobs, 2019-04-05), whose original version did
not have it, but was later amended with

  https://lore.kernel.org/git/[email-masked]/

And after that it survived across evolutions like b14ed5ad (Use
promisor_remote_get_direct() and has_promisor_remote(), 2019-06-25),
95acf11a (diff: restrict when prefetching occurs, 2020-04-07), and
finally a5183d76 (cocci: apply the "promisor-remote.h" part of
"the_repository.pending", 2023-03-28).