diff options
author | Elijah Newren <newren@gmail.com> | 2010-09-20 12:28:45 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-30 04:32:37 +0400 |
commit | 583942df098b04f545fb6bbe7b0d1590cc7b7b1d (patch) | |
tree | 6dede22d80e0995405f9a25978cf8fa89d9cd88f /t/t6036-recursive-corner-cases.sh | |
parent | c976260d0f3d3f99dc3594e3f98436bfd920dc97 (diff) |
t6036: Add a second testcase similar to the first but with content changes
c94736a (merge-recursive: don't segfault while handling rename clashes
2009-07-30) added t6036 with a testcase that involved dual renames and a
criss-cross merge. Add a test that is nearly identical, but which also
involves content modification -- a case git currently does not merge
correctly.
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 | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh index 1755073735..9206c22ffb 100755 --- a/t/t6036-recursive-corner-cases.sh +++ b/t/t6036-recursive-corner-cases.sh @@ -70,4 +70,80 @@ test_expect_success 'merge simple rename+criss-cross with no modifications' ' test $(git rev-parse :1:three) = $(git hash-object merged) ' +# +# Same as before, but modify L1 slightly: +# +# L1m L2 +# o---o +# / \ / \ +# o X ? +# \ / \ / +# o---o +# R1 R2 +# + +test_expect_success 'setup criss-cross + rename merges with basic modification' ' + git rm -rf . && + git clean -fdqx && + rm -rf .git && + git init && + + ten="0 1 2 3 4 5 6 7 8 9" + for i in $ten + do + echo line $i in a sample file + done >one && + for i in $ten + do + echo line $i in another sample file + done >two && + git add one two && + test_tick && git commit -m initial && + + git branch L1 && + git checkout -b R1 && + git mv one three && + echo more >>two && + git add two && + test_tick && git commit -m R1 && + + git checkout L1 && + git mv two three && + test_tick && git commit -m L1 && + + git checkout L1^0 && + test_tick && git merge -s ours R1 && + git tag L2 && + + git checkout R1^0 && + test_tick && git merge -s ours L1 && + git tag R2 +' + +test_expect_failure 'merge criss-cross + rename merges with basic modification' ' + git reset --hard && + git checkout L2^0 && + + test_must_fail git merge -s recursive R2^0 && + + test 5 = $(git ls-files -s | wc -l) && + test 3 = $(git ls-files -u | wc -l) && + test 0 = $(git ls-files -o | wc -l) && + + test $(git rev-parse :0:one) = $(git rev-parse L2:one) && + test $(git rev-parse :0:two) = $(git rev-parse R2:two) && + test $(git rev-parse :2:three) = $(git rev-parse L2:three) && + test $(git rev-parse :3:three) = $(git rev-parse R2:three) && + + head -n 10 two >merged && + cp one merge-me && + >empty && + test_must_fail git merge-file \ + -L "Temporary merge branch 2" \ + -L "" \ + -L "Temporary merge branch 1" \ + merged empty merge-me && + test $(git rev-parse :1:three) = $(git hash-object merged) +' + test_done |