Subject: Re: [PATCH] diff: avoid segfault with freed entries

From: Junio C Hamano <[email-masked]>
Date: Tue, 30 Dec 2025 13:38:30 +0900

"Derrick Stolee via GitGitGadget" <[email-masked]> writes:

> The more elaborate explanation is that within diffcore_std(), we may
> skip the initial prefetch due to the output format (--name-only in the
> test) and go straight to diffcore_skip_stat_unmatch().

That's very interesting.  We have code to fetch on-demand when it
turns out that the initial prefetch shouldn't have been skipped and
we need contents, so in that sense, the condition to skip the
initial prefetch does not have to be precise, but we may want to see
if we can have a single helper function that exactly tells us if we
need to look at the contents or not.  I think we had a few changes
that made the definition of "diff status is based on contents" in
the past few releases, not for the purpose of this prefetch skipping
but to set the exit status.