t4058: add more tests and documentation for duplicate tree entry handling
authorElijah Newren <redacted>
Fri, 11 Dec 2020 09:08:44 +0000 (09:08 +0000)
committerJunio C Hamano <redacted>
Mon, 14 Dec 2020 17:34:50 +0000 (09:34 -0800)
commit5c72261c664e330e4fec7b9374896ba4fd75ad9f
treeec1838adc6b1b921a5629ad75dccc75ea6b06d2e
parent81c4bf02964e51d0cde79304794d51da86d23b09
t4058: add more tests and documentation for duplicate tree entry handling

Commit 4d6be03b95 ("diffcore-rename: avoid processing duplicate
destinations", 2015-02-26) added t4058 to demonstrate that a workaround
it added to avoid double frees (namely to just turn off rename detection
when trees had duplicate entries) would indeed avoid segfaults.  The
tests, though, give the impression that the expected diffs are "correct"
when in reality they are just "don't segfault, and do something
semi-reasonable under the circumstances".  Add some notes to make this
clearer.

Also, commit 25d5ea410f ("[PATCH] Redo rename/copy detection logic.",
2005-05-24) added a similar workaround to avoid segfaults, but for
rename_src rather than rename_dst.  I do not see any tests in the
testsuite to cover the collision detection of entries limited to the
source side, so add a couple.

Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
t/t4058-diff-duplicates.sh
git clone https://git.99rst.org/PROJECT