53
EOF
54
}
55
56
-create_expected_success_merge () {
57
- cat >expected <<-EOF
58
- $(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
59
- HEAD is now at $(git rev-parse --short feature-branch) third commit
60
- First, rewinding head to replay your work on top of it...
61
- Merging unrelated-onto-branch with HEAD~1
62
- Merging:
63
- $(git rev-parse --short unrelated-onto-branch) unrelated commit
64
- $(git rev-parse --short feature-branch^) second commit
65
- found 1 common ancestor:
66
- $(git rev-parse --short feature-branch~2) initial commit
67
- [detached HEAD $(git rev-parse --short rebased-feature-branch~1)] second commit
68
- Author: A U Thor <author@example.com>
69
- Date: Thu Apr 7 15:14:13 2005 -0700
70
- 2 files changed, 2 insertions(+)
71
- create mode 100644 file1
72
- create mode 100644 file2
73
- Committed: 0001 second commit
74
- Merging unrelated-onto-branch with HEAD~0
75
- Merging:
76
- $(git rev-parse --short rebased-feature-branch~1) second commit
77
- $(git rev-parse --short feature-branch) third commit
78
- found 1 common ancestor:
79
- $(git rev-parse --short feature-branch~1) second commit
80
- [detached HEAD $(git rev-parse --short rebased-feature-branch)] third commit
81
- Author: A U Thor <author@example.com>
82
- Date: Thu Apr 7 15:15:13 2005 -0700
83
- 1 file changed, 1 insertion(+)
84
- create mode 100644 file3
85
- Committed: 0002 third commit
86
- All done.
87
- Applied autostash.
88
- EOF
89
-}
90
-
56
create_expected_failure_am () {
57
cat >expected <<-EOF
58
$(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
77
EOF
78
}
79
115
-create_expected_failure_merge () {
116
- cat >expected <<-EOF
117
- $(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
118
- HEAD is now at $(git rev-parse --short feature-branch) third commit
119
- First, rewinding head to replay your work on top of it...
120
- Merging unrelated-onto-branch with HEAD~1
121
- Merging:
122
- $(git rev-parse --short unrelated-onto-branch) unrelated commit
123
- $(git rev-parse --short feature-branch^) second commit
124
- found 1 common ancestor:
125
- $(git rev-parse --short feature-branch~2) initial commit
126
- [detached HEAD $(git rev-parse --short rebased-feature-branch~1)] second commit
127
- Author: A U Thor <author@example.com>
128
- Date: Thu Apr 7 15:14:13 2005 -0700
129
- 2 files changed, 2 insertions(+)
130
- create mode 100644 file1
131
- create mode 100644 file2
132
- Committed: 0001 second commit
133
- Merging unrelated-onto-branch with HEAD~0
134
- Merging:
135
- $(git rev-parse --short rebased-feature-branch~1) second commit
136
- $(git rev-parse --short feature-branch) third commit
137
- found 1 common ancestor:
138
- $(git rev-parse --short feature-branch~1) second commit
139
- [detached HEAD $(git rev-parse --short rebased-feature-branch)] third commit
140
- Author: A U Thor <author@example.com>
141
- Date: Thu Apr 7 15:15:13 2005 -0700
142
- 1 file changed, 1 insertion(+)
143
- create mode 100644 file3
144
- Committed: 0002 third commit
145
- All done.
146
- Applying autostash resulted in conflicts.
147
- Your changes are safe in the stash.
148
- You can run "git stash pop" or "git stash drop" at any time.
149
- EOF
150
-}
151
-
80
testrebase () {
81
type=$1
82
dotest=$2
105
test_expect_success "rebase$type --autostash: check output" '
106
test_when_finished git branch -D rebased-feature-branch &&
107
suffix=${type#\ --} && suffix=${suffix:-am} &&
108
+ if test ${suffix} = "merge"; then
109
+ suffix=interactive
110
+ fi &&
111
create_expected_success_$suffix &&
112
test_i18ncmp expected actual
113
'
205
test_expect_success "rebase$type: check output with conflicting stash" '
206
test_when_finished git branch -D rebased-feature-branch &&
207
suffix=${type#\ --} && suffix=${suffix:-am} &&
208
+ if test ${suffix} = "merge"; then
209
+ suffix=interactive
210
+ fi &&
211
create_expected_failure_$suffix &&
212
test_i18ncmp expected actual
213
'