Skip to content

Commit f7951e1

Browse files
dschogitster
authored andcommitted
Simplify t3412
Use the newly introduced test_commit() and test_merge() helpers. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 37e5c8f commit f7951e1

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

t/t3412-rebase-root.sh

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,13 @@ Tests if git rebase --root --onto <newparent> can rebase the root commit.
77
. ./test-lib.sh
88

99
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 &&
1612
git symbolic-ref HEAD refs/heads/other &&
1713
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
2717
'
2818

2919
test_expect_success 'rebase --root expects --onto' '
@@ -103,9 +93,7 @@ test_expect_success 'pre-rebase got correct input (5)' '
10393
test_expect_success 'set up merge history' '
10494
git checkout other^ &&
10595
git checkout -b side &&
106-
echo 5 > C &&
107-
git add C &&
108-
git commit -m 5 &&
96+
test_commit 5 C &&
10997
git checkout other &&
11098
git merge side
11199
'
@@ -132,9 +120,7 @@ test_expect_success 'set up second root and merge' '
132120
git symbolic-ref HEAD refs/heads/third &&
133121
rm .git/index &&
134122
rm A B C &&
135-
echo 6 > D &&
136-
git add D &&
137-
git commit -m 6 &&
123+
test_commit 6 D &&
138124
git checkout other &&
139125
git merge third
140126
'

0 commit comments

Comments
 (0)