Simplify t3412

Use the newly introduced test_commit() and test_merge() helpers.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin 2009-01-27 23:35:09 +01:00 committed by Junio C Hamano
parent 37e5c8f460
commit f7951e1d97

View File

@ -7,23 +7,13 @@ Tests if git rebase --root --onto <newparent> can rebase the root commit.
. ./test-lib.sh . ./test-lib.sh
test_expect_success 'prepare repository' ' test_expect_success 'prepare repository' '
echo 1 > A && test_commit 1 A &&
git add A && test_commit 2 A &&
git commit -m 1 &&
echo 2 > A &&
git add A &&
git commit -m 2 &&
git symbolic-ref HEAD refs/heads/other && git symbolic-ref HEAD refs/heads/other &&
rm .git/index && rm .git/index &&
echo 3 > B && test_commit 3 B &&
git add B && test_commit 1b A 1 &&
git commit -m 3 && test_commit 4 B
echo 1 > A &&
git add A &&
git commit -m 1b &&
echo 4 > B &&
git add B &&
git commit -m 4
' '
test_expect_success 'rebase --root expects --onto' ' test_expect_success 'rebase --root expects --onto' '
@ -103,9 +93,7 @@ test_expect_success 'pre-rebase got correct input (5)' '
test_expect_success 'set up merge history' ' test_expect_success 'set up merge history' '
git checkout other^ && git checkout other^ &&
git checkout -b side && git checkout -b side &&
echo 5 > C && test_commit 5 C &&
git add C &&
git commit -m 5 &&
git checkout other && git checkout other &&
git merge side git merge side
' '
@ -132,9 +120,7 @@ test_expect_success 'set up second root and merge' '
git symbolic-ref HEAD refs/heads/third && git symbolic-ref HEAD refs/heads/third &&
rm .git/index && rm .git/index &&
rm A B C && rm A B C &&
echo 6 > D && test_commit 6 D &&
git add D &&
git commit -m 6 &&
git checkout other && git checkout other &&
git merge third git merge third
' '