1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-05 00:37:55 +01:00
git/t/t6036-recursive-corner-cases.sh
Jonathan Nieder a48fcd8369 tests: add missing &&
Breaks in a test assertion's && chain can potentially hide
failures from earlier commands in the chain.

Commands intended to fail should be marked with !, test_must_fail, or
test_might_fail.  The examples in this patch do not require that.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-09 11:59:49 -08:00

55 lines
863 B
Bash
Executable file

#!/bin/sh
test_description='recursive merge corner cases'
. ./test-lib.sh
#
# L1 L2
# o---o
# / \ / \
# o X ?
# \ / \ /
# o---o
# R1 R2
#
test_expect_success setup '
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 &&
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_success merge '
git reset --hard &&
git checkout L2^0 &&
test_must_fail git merge -s recursive R2^0
'
test_done