]> git.ipfire.org Git - thirdparty/git.git/commit - merge-ort.c
merge-ort: fix bug with renormalization and rename/delete conflicts
authorElijah Newren <newren@gmail.com>
Tue, 28 Dec 2021 00:20:46 +0000 (00:20 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Dec 2021 18:40:26 +0000 (10:40 -0800)
commitd30126c20d5899f128facbd33ecf27163efe1326
tree4aa9934f54b5c790ed7053645bd3f1efdce1200a
parente9d7761bb94f20acc98824275e317fa82436c25d
merge-ort: fix bug with renormalization and rename/delete conflicts

Ever since commit a492d5331c ("merge-ort: ensure we consult df_conflict
and path_conflicts", 2021-06-30), when renormalization is active AND a
file is involved in a rename/delete conflict BUT the file is unmodified
(either before or after renormalization), merge-ort was running into an
assertion failure.  Prior to that commit (or if assertions were compiled
out), merge-ort would mis-merge instead, ignoring the rename/delete
conflict and just deleting the file.

Remove the assertions, fix the code appropriately, leave some good
comments in the code, and add a testcase for this situation.

Reported-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-ort.c
t/t6418-merge-text-auto.sh