From: Elijah Newren Date: Thu, 19 Feb 2026 20:53:29 GMT Subject: Re: [PATCH 4/5] merge-ort: prevent the_repository from coming back Message-ID: In-Reply-To: On Thu, Feb 19, 2026 at 12:30 PM Junio C Hamano wrote: > > Elijah Newren 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 ;-) Thanks! > 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/20190405170934.20441-1-jonathantanmy@google.com/ Ah, the explanation in that email doesn't exist inside the commit history, since the diff was squashed in and the relevant part of the explanation wasn't added to the commit message. I should have thought to check the mail archives too. Anyway, the important bit is: > Also, prefetch only if the repository being diffed > is the_repository (because we do not support lazy fetching for any other > repository anyway). This comment came from mid-2019. I then copied the logic from diffcore_std() in 2020 (though didn't get the relevant patch upstream until 2021), and as of 2021 we have ef830cc43412 (promisor-remote: teach lazy-fetch in any repo, 2021-06-17), which means that this check has been obsoleted by events. And it looks like the check in diffcore_std() was left in place as an oversight as well. So, we don't need that check anymore. I'll add a commit that simply removes these checks from both merge-ort.c and diff.c and reduces two more uses of the_repository.