diff --no-index tests: test mode normalization
commit2be927f3d1c64217ac5f4d3139ad73c1f59c173b
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 21 Mar 2021 22:36:20 +0000 (21 23:36 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Mar 2021 19:22:26 +0000 (22 12:22 -0700)
treedd3fdaea9af275dd066268541e8a6aa5e47ed62b
parent271cb303a507c8e37fa894c36569c18c6d134510
diff --no-index tests: test mode normalization

When "git diff --no-index X Y" is run the modes of the files being
differ are normalized by canon_mode() in fill_filespec().

I recently broke that behavior in a patch of mine[1] which would pass
all tests, or not, depending on the umask of the git.git checkout.

Let's test for this explicitly. Arguably this should not be the
behavior of "git diff --no-index". We aren't diffing our own objects
or the index, so it might be useful to show mode differences between
files.

On the other hand diff(1) does not do that, and it would be needlessly
distracting when e.g. diffing an extracted tar archive whose contents
is the same, but whose file modes are different.

1. https://lore.kernel.org/git/20210316155829.31242-2-avarab@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4053-diff-no-index.sh