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>
Johannes Schindelin committed
Jan 27, 2009 at 23:35 UTC
f7951e1d97aeb7b3ed359faeab5edf9e870ec8a5
1 file changed
+7
-21
t/t3412-rebase-root.sh
+7
-21
@@ -7,23 +7,13 @@ Tests if git rebase --root --onto <newparent> can rebase the root commit.
7
. ./test-lib.sh
8
9
test_expect_success 'prepare repository' '
10
- echo 1 > A &&
11
- git add A &&
12
- git commit -m 1 &&
13
- echo 2 > A &&
14
- git add A &&
15
- git commit -m 2 &&
10
+ test_commit 1 A &&
11
+ test_commit 2 A &&
12
git symbolic-ref HEAD refs/heads/other &&
13
rm .git/index &&
18
- echo 3 > B &&
19
- git add B &&
20
- git commit -m 3 &&
21
- echo 1 > A &&
22
- git add A &&
23
- git commit -m 1b &&
24
- echo 4 > B &&
25
- git add B &&
26
- git commit -m 4
14
+ test_commit 3 B &&
15
+ test_commit 1b A 1 &&
16
+ test_commit 4 B
17
'
18
19
test_expect_success 'rebase --root expects --onto' '
@@ -103,9 +93,7 @@ test_expect_success 'pre-rebase got correct input (5)' '
93
test_expect_success 'set up merge history' '
94
git checkout other^ &&
95
git checkout -b side &&
106
- echo 5 > C &&
107
- git add C &&
108
- git commit -m 5 &&
96
+ test_commit 5 C &&
97
git checkout other &&
98
git merge side
99
'
@@ -132,9 +120,7 @@ test_expect_success 'set up second root and merge' '
120
git symbolic-ref HEAD refs/heads/third &&
121
rm .git/index &&
122
rm A B C &&
135
- echo 6 > D &&
136
- git add D &&
137
- git commit -m 6 &&
123
+ test_commit 6 D &&
124
git checkout other &&
125
git merge third
126
'