@matheusbsbs / matheus-bagliano / commits / e8eb99d4a6
Fork 0

t642[23]: be more flexible for add/add conflicts involving pair renames

Much like the last commit accepted 'add/add' and 'rename/add' interchangably, we also want to do the same for 'add/add' and 'rename/rename'. This also allows us to avoid the ambiguity in meaning with 'rename/rename' (is it two separate files renamed to the same location, or one file renamed on both sides but differently)? Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Aug 10, 2020 at 22:29 UTC e8eb99d4a6b2505c15a2be916d611f4e7f9cde2f
2 files changed +14 -8
t/t6422-merge-rename-corner-cases.sh
+12 -6
@@ -583,7 +583,7 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
583 git checkout B^0 &&
584
585 test_must_fail git merge -s recursive C^0 >out &&
586 - test_i18ngrep "CONFLICT (rename/rename)" out &&
586 + test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
587
588 git ls-files -s >out &&
589 test_line_count = 2 out &&
@@ -959,11 +959,17 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
959 git checkout A^0 &&
960 test_must_fail git merge -s recursive B^0 >out 2>err &&
961
962 - # Not sure whether the output should contain just one
963 - # "CONFLICT (rename/rename/delete/delete)" line, or if it
964 - # should break it into three: "CONFLICT (rename/rename)" and
965 - # two "CONFLICT (rename/delete)" lines; allow for either.
966 - test_i18ngrep "CONFLICT (rename/rename)" out &&
962 + # Instead of requiring the output to contain one combined line
963 + # CONFLICT (rename/rename/delete/delete)
964 + # or perhaps two lines:
965 + # CONFLICT (rename/rename): ...
966 + # CONFLICT (rename/delete): info about pair 1
967 + # CONFLICT (rename/delete): info about pair 2
968 + # and instead of requiring "rename/rename" instead of "add/add",
969 + # be flexible in the type of console output message(s) reported
970 + # for this particular case; we will be more stringent about the
971 + # contents of the index and working directory.
972 + test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
973 test_i18ngrep "CONFLICT (rename.*delete)" out &&
974 test_must_be_empty err &&
975
t/t6423-merge-rename-directories.sh
+2 -2
@@ -275,7 +275,7 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
275 git checkout A^0 &&
276
277 test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
278 - test_i18ngrep "CONFLICT (rename/rename)" out &&
278 + test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
279
280 git ls-files -s >out &&
281 test_line_count = 8 out &&
@@ -1686,7 +1686,7 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
1686 git checkout A^0 &&
1687
1688 test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
1689 - test_i18ngrep "CONFLICT (rename/rename)" out &&
1689 + test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
1690
1691 git ls-files -s >out &&
1692 test_line_count = 4 out &&