Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2021-12-28 03:20:46 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-30 21:40:26 +0300
commitd30126c20d5899f128facbd33ecf27163efe1326 (patch)
tree4aa9934f54b5c790ed7053645bd3f1efdce1200a /t/t6418-merge-text-auto.sh
parente9d7761bb94f20acc98824275e317fa82436c25d (diff)
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>
Diffstat (limited to 't/t6418-merge-text-auto.sh')
-rwxr-xr-xt/t6418-merge-text-auto.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t6418-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
index 1e0296dd17..41288a60ce 100755
--- a/t/t6418-merge-text-auto.sh
+++ b/t/t6418-merge-text-auto.sh
@@ -204,4 +204,30 @@ test_expect_success 'Test delete/normalize conflict' '
test_path_is_missing file
'
+test_expect_success 'rename/delete vs. renormalization' '
+ git init subrepo &&
+ (
+ cd subrepo &&
+ echo foo >oldfile &&
+ git add oldfile &&
+ git commit -m original &&
+
+ git branch rename &&
+ git branch nuke &&
+
+ git checkout rename &&
+ git mv oldfile newfile &&
+ git commit -m renamed &&
+
+ git checkout nuke &&
+ git rm oldfile &&
+ git commit -m deleted &&
+
+ git checkout rename^0 &&
+ test_must_fail git -c merge.renormalize=true merge nuke >out &&
+
+ grep "rename/delete" out
+ )
+'
+
test_done