diff options
author | Elijah Newren <newren@gmail.com> | 2011-08-12 09:20:11 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-15 01:19:38 +0400 |
commit | ec61d14963470b02db0d6e3825e2b5bbb1815cb6 (patch) | |
tree | eb2925c7839584acf9575b31625b37526e362804 /t/t6036-recursive-corner-cases.sh | |
parent | 5b448b8530308b1f5a7a721cb1bf0ba557b5c78d (diff) |
merge-recursive: Fix modify/delete resolution in the recursive case
When o->call_depth>0 and we have conflicts, we try to find "middle ground"
when creating the virtual merge base. In the case of content conflicts,
this can be done by doing a three-way content merge and using the result.
In all parts where the three-way content merge is clean, it is the correct
middle ground, and in parts where it conflicts there is no middle ground
but the conflict markers provide a good compromise since they are unlikely
to accidentally match any further changes.
In the case of a modify/delete conflict, we cannot do the same thing.
Accepting either endpoint as the resolution for the virtual merge base
runs the risk that when handling the non-recursive case we will silently
accept one person's resolution over another without flagging a conflict.
In this case, the closest "middle ground" we have is actually the merge
base of the candidate merge bases. (We could alternatively attempt a
three way content merge using an empty file in place of the deleted file,
but that seems to be more work than necessary.)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6036-recursive-corner-cases.sh')
-rwxr-xr-x | t/t6036-recursive-corner-cases.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh index b046e1be71..314fdaeb18 100755 --- a/t/t6036-recursive-corner-cases.sh +++ b/t/t6036-recursive-corner-cases.sh @@ -296,7 +296,7 @@ test_expect_success 'setup criss-cross + modify/delete resolved differently' ' git tag E ' -test_expect_failure 'git detects conflict merging criss-cross+modify/delete' ' +test_expect_success 'git detects conflict merging criss-cross+modify/delete' ' git checkout D^0 && test_must_fail git merge -s recursive E^0 && @@ -308,7 +308,7 @@ test_expect_failure 'git detects conflict merging criss-cross+modify/delete' ' test $(git rev-parse :2:file) = $(git rev-parse B:file) ' -test_expect_failure 'git detects conflict merging criss-cross+modify/delete, reverse direction' ' +test_expect_success 'git detects conflict merging criss-cross+modify/delete, reverse direction' ' git reset --hard && git checkout E^0 && |