aboutsummaryrefslogtreecommitdiff
path: root/t/t6042-merge-rename-corner-cases.sh
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2011-08-11 23:20:18 -0600
committerJunio C Hamano <gitster@pobox.com>2011-08-14 14:19:39 -0700
commit434b8525e7a68893106f6360ff0a261f03c37512 (patch)
treea618e0629b7224b8336ed9e9b2d9ae8d16e76659 /t/t6042-merge-rename-corner-cases.sh
parentdac4741554e7672e69d1bc6b4f912cd16ad83b38 (diff)
downloadgit-434b8525e7a68893106f6360ff0a261f03c37512.tar.gz
git-434b8525e7a68893106f6360ff0a261f03c37512.tar.xz
merge-recursive: Consider modifications in rename/rename(2to1) conflicts
Our previous conflict resolution for renaming two different files to the same name ignored the fact that each of those files may have modifications from both sides of history to consider. We need to do a three-way merge for each of those files, and then handle the conflict of both sets of merged contents trying to be recorded with the same name. It is important to note that this changes our strategy in the recursive case. After doing a three-way content merge of each of the files involved, we still are faced with the fact that we are trying to put both of the results (including conflict markers) into the same path. We could do another two-way merge, but I think that becomes confusing. Also, taking a hint from the modify/delete and rename/delete cases we handled earlier, a more useful "common ground" would be to keep the three-way content merge but record it with the original filename. The renames can still be detected, we just allow it to be done in the o->call_depth=0 case. This seems to result in simpler & easier to understand merge conflicts as well, as evidenced by some of the changes needed in our testsuite in t6036. (However, it should be noted that this change will cause problems those renames also occur along with a file being added whose name matches the source of the rename. Since git currently cannot detect rename/add-source situations, though, this codepath is not currently used for those cases anyway. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6042-merge-rename-corner-cases.sh')
-rwxr-xr-xt/t6042-merge-rename-corner-cases.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh
index bfc317933..3be505931 100755
--- a/t/t6042-merge-rename-corner-cases.sh
+++ b/t/t6042-merge-rename-corner-cases.sh
@@ -376,7 +376,7 @@ test_expect_success 'setup rename/rename (2to1) + modify/modify' '
git commit -m C
'
-test_expect_failure 'handle rename/rename (2to1) conflict correctly' '
+test_expect_success 'handle rename/rename (2to1) conflict correctly' '
git checkout B^0 &&
test_must_fail git merge -s recursive C^0 >out &&