Re: [PATCH v3] Teach git apply to respect core.fileMode settings
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 26, 2023, 20:58 UTC
- Message-ID
- <xmqqv88kfzpr.fsf@gitster.g>
- In-Reply-To
- <xmqq4jg4j28z.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
>> 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"?