Skip to content

Commit 9e2248e

Browse files
martinvonzgitster
authored andcommitted
t3406: modernize style
Update the following: - Quote 'setup' - Remove blank lines within test case body - Use test_commit instead of custom quick_one - Create branch "topic" from tag created by test_commit Signed-off-by: Martin von Zweigbergk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3f21398 commit 9e2248e

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

t/t3406-rebase-message.sh

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,17 @@ test_description='messages from rebase operation'
44

55
. ./test-lib.sh
66

7-
quick_one () {
8-
echo "$1" >"file$1" &&
9-
git add "file$1" &&
10-
test_tick &&
11-
git commit -m "$1"
12-
}
7+
test_expect_success 'setup' '
8+
test_commit O fileO &&
9+
test_commit X fileX &&
10+
test_commit A fileA &&
11+
test_commit B fileB &&
12+
test_commit Y fileY &&
1313
14-
test_expect_success setup '
15-
quick_one O &&
16-
git branch topic &&
17-
quick_one X &&
18-
quick_one A &&
19-
quick_one B &&
20-
quick_one Y &&
21-
22-
git checkout topic &&
23-
quick_one A &&
24-
quick_one B &&
25-
quick_one Z &&
14+
git checkout -b topic O &&
15+
git cherry-pick A B &&
16+
test_commit Z fileZ &&
2617
git tag start
27-
2818
'
2919

3020
cat >expect <<\EOF
@@ -34,12 +24,10 @@ Committed: 0003 Z
3424
EOF
3525

3626
test_expect_success 'rebase -m' '
37-
3827
git rebase -m master >report &&
3928
sed -n -e "/^Already applied: /p" \
4029
-e "/^Committed: /p" report >actual &&
4130
test_cmp expect actual
42-
4331
'
4432

4533
test_expect_success 'rebase --stat' '

0 commit comments

Comments
 (0)