1#!/bin/sh
23
test_description='messages from rebase operation'
45
. ./test-lib.sh
67
quick_one () {
8echo "$1" >"file$1" &&
9git add "file$1" &&
10test_tick &&
11git commit -m "$1"
12}
1314
test_expect_success setup '
15quick_one O &&
16git branch topic &&
17quick_one X &&
18quick_one A &&
19quick_one B &&
20quick_one Y &&
2122
git checkout topic &&
23quick_one A &&
24quick_one B &&
25quick_one Z &&
26git tag start
2728
'
2930
cat >expect <<\EOF
31Already applied: 0001 A
32Already applied: 0002 B
33Committed: 0003 Z
34EOF
3536
test_expect_success 'rebase -m' '
3738
git rebase -m master >report &&
39sed -n -e "/^Already applied: /p" \
40-e "/^Committed: /p" report >actual &&
41test_cmp expect actual
4243
'
4445
test_expect_success 'rebase --stat' '
46git reset --hard start &&
47git rebase --stat master >diffstat.txt &&
48grep "^ fileX | *1 +$" diffstat.txt
49'
5051
test_expect_success 'rebase w/config rebase.stat' '
52git reset --hard start &&
53git config rebase.stat true &&
54git rebase master >diffstat.txt &&
55grep "^ fileX | *1 +$" diffstat.txt
56'
5758
test_expect_success 'rebase -n overrides config rebase.stat config' '
59git reset --hard start &&
60git config rebase.stat true &&
61git rebase -n master >diffstat.txt &&
62! grep "^ fileX | *1 +$" diffstat.txt
63'
6465
test_done