Skip to content

Commit e8eb99d

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2a7c16c commit e8eb99d

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

t/t6422-merge-rename-corner-cases.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
583583
git checkout B^0 &&
584584
585585
test_must_fail git merge -s recursive C^0 >out &&
586-
test_i18ngrep "CONFLICT (rename/rename)" out &&
586+
test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
587587
588588
git ls-files -s >out &&
589589
test_line_count = 2 out &&
@@ -959,11 +959,17 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
959959
git checkout A^0 &&
960960
test_must_fail git merge -s recursive B^0 >out 2>err &&
961961
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 &&
967973
test_i18ngrep "CONFLICT (rename.*delete)" out &&
968974
test_must_be_empty err &&
969975

t/t6423-merge-rename-directories.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
275275
git checkout A^0 &&
276276
277277
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 &&
279279
280280
git ls-files -s >out &&
281281
test_line_count = 8 out &&
@@ -1686,7 +1686,7 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
16861686
git checkout A^0 &&
16871687
16881688
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 &&
16901690
16911691
git ls-files -s >out &&
16921692
test_line_count = 4 out &&

0 commit comments

Comments
 (0)