Subject: Re: [PATCH v3] Teach git apply to respect core.fileMode settings

From: Junio C Hamano <[email-masked]>
Date: Tue, 26 Dec 2023 12:58:24 -0800

Junio C Hamano <[email-masked]> writes:

>> As pointed out e.g. by t2016.3(git checkout -p), if the patch is to be
>> applied in reverse (`git apply -R`), then the `old_mode` is actually 0,
>> and we must use `new_mode` instead.
>
> Good finding.

Hmph, this is puzzling and I spoke way before I understand why/how
the fixup patch works X-<.

The caller of check_preimage(), check_patch(), should happen only
after reverse_patches() swapped old and new names and modes in
apply_patch(), so at this point, we should be able to consistently
use old_mode for checking, shouldn't we, even with "-R"?