t3031-merge-criscross.sh [plain text]
#!/bin/sh
test_description='merge-recursive backend test'
. ./test-lib.sh
test_expect_success 'setup repo with criss-cross history' '
mkdir data &&
n=1 &&
while test $n -le 10
do
echo $n > data/$n &&
n=$(($n+1)) ||
break
done &&
git add data &&
git commit -m A &&
git branch A &&
git checkout -b B A &&
git rm data/9 &&
git add data &&
git commit -m B &&
git branch D &&
git checkout D &&
echo testD > data/testD &&
git add data &&
git commit -m D &&
git checkout -b C A &&
git mv data/9 data/new-9 &&
git add data &&
git commit -m C &&
git branch E &&
git checkout E &&
echo testE > data/testE &&
git add data &&
git commit -m E &&
git checkout B &&
test_must_fail git merge E &&
git add data &&
git commit -m F &&
git branch F &&
git checkout C &&
test_must_fail git merge D &&
git add data &&
git commit -m G &&
git branch G
'
test_expect_success 'recursive merge between F and G, causes segfault' '
git merge F
'
test_done