From: Aniket Gupta Date: Fri, 06 Nov 2026 18:11:45 GMT Subject: Re: [BUG] git apply: pure rename followed by edit fails with core.fileMode=false Message-ID: <20261106181145.1070831-1-aniketgupta3001@gmail.com> In-Reply-To: Hi Hannes, I was able to repro this. One thing I noticed: taking the whole mode from patch->old_mode also takes the file type, so the "wrong type" check can no longer fail. With a pure rename of a regular file followed by a hand-made patch that says it is a symlink, core.fileMode=true rejects it but =false applies it and turns the file into a symlink. Would S_IFREG | (patch->old_mode & 07777) be better? That passed your test and the other apply tests for me. Thanks, Aniket