]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t642[23]: be more flexible for add/add conflicts involving pair renames
authorElijah Newren <newren@gmail.com>
Mon, 10 Aug 2020 22:29:18 +0000 (22:29 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Aug 2020 22:59:01 +0000 (15:59 -0700)
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>
t/t6422-merge-rename-corner-cases.sh
t/t6423-merge-rename-directories.sh

index f3929b65c0f9fa6e44b5735233bc20922009f435..3375eaf4e76daa23c0a9e65fd6b7e060cc04f601 100755 (executable)
@@ -583,7 +583,7 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
                git checkout B^0 &&
 
                test_must_fail git merge -s recursive C^0 >out &&
-               test_i18ngrep "CONFLICT (rename/rename)" out &&
+               test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 
                git ls-files -s >out &&
                test_line_count = 2 out &&
@@ -959,11 +959,17 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
                git checkout A^0 &&
                test_must_fail git merge -s recursive B^0 >out 2>err &&
 
-               # Not sure whether the output should contain just one
-               # "CONFLICT (rename/rename/delete/delete)" line, or if it
-               # should break it into three: "CONFLICT (rename/rename)" and
-               # two "CONFLICT (rename/delete)" lines; allow for either.
-               test_i18ngrep "CONFLICT (rename/rename)" out &&
+               # Instead of requiring the output to contain one combined line
+               #   CONFLICT (rename/rename/delete/delete)
+               # or perhaps two lines:
+               #   CONFLICT (rename/rename): ...
+               #   CONFLICT (rename/delete): info about pair 1
+               #   CONFLICT (rename/delete): info about pair 2
+               # and instead of requiring "rename/rename" instead of "add/add",
+               # be flexible in the type of console output message(s) reported
+               # for this particular case; we will be more stringent about the
+               # contents of the index and working directory.
+               test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
                test_i18ngrep "CONFLICT (rename.*delete)" out &&
                test_must_be_empty err &&
 
index 2b4a482277b90667cf69fba4ee750ade6d3ec5a1..f7ecbb886d6191c4bb2e8c1da8b23e0a1e22d47d 100755 (executable)
@@ -275,7 +275,7 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
                git checkout A^0 &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
-               test_i18ngrep "CONFLICT (rename/rename)" out &&
+               test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 
                git ls-files -s >out &&
                test_line_count = 8 out &&
@@ -1686,7 +1686,7 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
                git checkout A^0 &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
-               test_i18ngrep "CONFLICT (rename/rename)" out &&
+               test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 
                git ls-files -s >out &&
                test_line_count = 4 out &&