]> git.ipfire.org Git - thirdparty/git.git/commit
t4129: test that git apply warns for unexpected mode changes
authorMark Mentovai <mark@chromium.org>
Sat, 24 May 2025 03:40:45 +0000 (23:40 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 May 2025 13:48:07 +0000 (06:48 -0700)
commit2cc8c17d67265f1912b79f8e57fc2718597ca686
tree12a71bd66b16cef0a8635b61f51499cc7c26f0f3
parent8613c2bb6cd16ef530dc5dd74d3b818a1ccbf1c0
t4129: test that git apply warns for unexpected mode changes

There is no test covering what commit 01aff0a (apply: correctly reverse
patch's pre- and post-image mode bits, 2023-12-26) addressed. Prior to
that commit, git apply was erroneously unaware of a file's expected mode
while reverse-patching a file whose mode was not changing.

Add the missing test coverage to assure that git apply is aware of the
expected mode of a file being patched when the patch does not indicate
that the file's mode is changing. This is achieved by arranging a file
mode so that it doesn't agree with patch being applied, and checking git
apply's output for the warning it's supposed to raise in this situation.
Test in both reverse and normal (forward) directions.

Signed-off-by: Mark Mentovai <mark@chromium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4129-apply-samemode.sh