diff-no-index: align D/F handling with that of normal Git
commit06151739988601b0fe6179c6c67a0031b85b536f
authorJunio C Hamano <gitster@pobox.com>
Sun, 22 Mar 2015 05:11:27 +0000 (21 22:11 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 Mar 2015 21:08:43 +0000 (26 14:08 -0700)
treed67e510b5ad547936014e1659445f50d7fe54785
parentc9e1f2c7f2acca17c629255b96761a4a1047a28a
diff-no-index: align D/F handling with that of normal Git

When a commit changes a path P that used to be a file to a directory
and creates a new path P/X in it, "git show" would say that file P
was removed and file P/X was created for such a commit.

However, if we compare two directories, D1 and D2, where D1 has a
file D1/P in it and D2 has a directory D2/P under which there is a
file D2/P/X, and ask "git diff --no-index D1 D2" to show their
differences, we simply get a refusal "file/directory conflict".

Surely, that may be what GNU diff does, but we can do better and it
is easy to do so.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-no-index.c
t/t4053-diff-no-index.sh