@@ -110,73 +110,107 @@ test_expect_success 'replay did not screw up the log message' '
110
110
111
111
test_expect_success ' extra headers' '
112
112
113
- git config format.headers "To: R. E. Cipient <[email protected] >
113
+ git config format.headers "To: R E Cipient <[email protected] >
114
114
" &&
115
- git config --add format.headers "Cc: S. E. Cipient <[email protected] >
115
+ git config --add format.headers "Cc: S E Cipient <[email protected] >
116
116
" &&
117
117
git format-patch --stdout master..side > patch2 &&
118
118
sed -e "/^\$/q" patch2 > hdrs2 &&
119
- grep "^To: R. E. Cipient <[email protected] >\$" hdrs2 &&
120
- grep "^Cc: S. E. Cipient <[email protected] >\$" hdrs2
119
+ grep "^To: R E Cipient <[email protected] >\$" hdrs2 &&
120
+ grep "^Cc: S E Cipient <[email protected] >\$" hdrs2
121
121
122
122
'
123
123
124
124
test_expect_success ' extra headers without newlines' '
125
125
126
- git config --replace-all format.headers "To: R. E. Cipient <[email protected] >" &&
127
- git config --add format.headers "Cc: S. E. Cipient <[email protected] >" &&
126
+ git config --replace-all format.headers "To: R E Cipient <[email protected] >" &&
127
+ git config --add format.headers "Cc: S E Cipient <[email protected] >" &&
128
128
git format-patch --stdout master..side >patch3 &&
129
129
sed -e "/^\$/q" patch3 > hdrs3 &&
130
- grep "^To: R. E. Cipient <[email protected] >\$" hdrs3 &&
131
- grep "^Cc: S. E. Cipient <[email protected] >\$" hdrs3
130
+ grep "^To: R E Cipient <[email protected] >\$" hdrs3 &&
131
+ grep "^Cc: S E Cipient <[email protected] >\$" hdrs3
132
132
133
133
'
134
134
135
135
test_expect_success ' extra headers with multiple To:s' '
136
136
137
- git config --replace-all format.headers "To: R. E. Cipient <[email protected] >" &&
138
- git config --add format.headers "To: S. E. Cipient <[email protected] >" &&
137
+ git config --replace-all format.headers "To: R E Cipient <[email protected] >" &&
138
+ git config --add format.headers "To: S E Cipient <[email protected] >" &&
139
139
git format-patch --stdout master..side > patch4 &&
140
140
sed -e "/^\$/q" patch4 > hdrs4 &&
141
- grep "^To: R. E. Cipient <[email protected] >,\$" hdrs4 &&
142
- grep "^ *S. E. Cipient <[email protected] >\$" hdrs4
141
+ grep "^To: R E Cipient <[email protected] >,\$" hdrs4 &&
142
+ grep "^ *S E Cipient <[email protected] >\$" hdrs4
143
143
'
144
144
145
- test_expect_success ' additional command line cc' '
145
+ test_expect_success ' additional command line cc (ascii) ' '
146
146
147
- git config --replace-all format.headers "Cc: R. E. Cipient <[email protected] >" &&
147
+ git config --replace-all format.headers "Cc: R E Cipient <[email protected] >" &&
148
+ git format-patch --cc="S E Cipient <[email protected] >" --stdout master..side | sed -e "/^\$/q" >patch5 &&
149
+ grep "^Cc: R E Cipient <[email protected] >,\$" patch5 &&
150
+ grep "^ *S E Cipient <[email protected] >\$" patch5
151
+ '
152
+
153
+ test_expect_failure ' additional command line cc (rfc822)' '
154
+
155
+ git config --replace-all format.headers "Cc: R E Cipient <[email protected] >" &&
148
156
git format-patch --cc="S. E. Cipient <[email protected] >" --stdout master..side | sed -e "/^\$/q" >patch5 &&
149
- grep "^Cc: R. E. Cipient <[email protected] >,\$" patch5 &&
150
- grep "^ *S. E. Cipient <[email protected] >\$" patch5
157
+ grep "^Cc: R E Cipient <[email protected] >,\$" patch5 &&
158
+ grep "^ *" S. E. Cipient" <[email protected] >\$" patch5
151
159
'
152
160
153
161
test_expect_success ' command line headers' '
154
162
155
163
git config --unset-all format.headers &&
156
- git format-patch --add-header="Cc: R. E. Cipient <[email protected] >" --stdout master..side | sed -e "/^\$/q" >patch6 &&
157
- grep "^Cc: R. E. Cipient <[email protected] >\$" patch6
164
+ git format-patch --add-header="Cc: R E Cipient <[email protected] >" --stdout master..side | sed -e "/^\$/q" >patch6 &&
165
+ grep "^Cc: R E Cipient <[email protected] >\$" patch6
158
166
'
159
167
160
168
test_expect_success ' configuration headers and command line headers' '
161
169
162
- git config --replace-all format.headers "Cc: R. E. Cipient <[email protected] >" &&
163
- git format-patch --add-header="Cc: S. E. Cipient <[email protected] >" --stdout master..side | sed -e "/^\$/q" >patch7 &&
164
- grep "^Cc: R. E. Cipient <[email protected] >,\$" patch7 &&
165
- grep "^ *S. E. Cipient <[email protected] >\$" patch7
170
+ git config --replace-all format.headers "Cc: R E Cipient <[email protected] >" &&
171
+ git format-patch --add-header="Cc: S E Cipient <[email protected] >" --stdout master..side | sed -e "/^\$/q" >patch7 &&
172
+ grep "^Cc: R E Cipient <[email protected] >,\$" patch7 &&
173
+ grep "^ *S E Cipient <[email protected] >\$" patch7
166
174
'
167
175
168
- test_expect_success ' command line To: header' '
176
+ test_expect_success ' command line To: header (ascii) ' '
169
177
170
178
git config --unset-all format.headers &&
179
+ git format-patch --to="R E Cipient <[email protected] >" --stdout master..side | sed -e "/^\$/q" >patch8 &&
180
+ grep "^To: R E Cipient <[email protected] >\$" patch8
181
+ '
182
+
183
+ test_expect_failure ' command line To: header (rfc822)' '
184
+
171
185
git format-patch --to="R. E. Cipient <[email protected] >" --stdout master..side | sed -e "/^\$/q" >patch8 &&
172
- grep "^To: R. E. Cipient <[email protected] >\$" patch8
186
+ grep "^To: "R. E. Cipient" <[email protected] >\$" patch8
187
+ '
188
+
189
+ test_expect_failure ' command line To: header (rfc2047)' '
190
+
191
+ git format-patch --to="R Ä Cipient <[email protected] >" --stdout master..side | sed -e "/^\$/q" >patch8 &&
192
+ grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <[email protected] >\$" patch8
173
193
'
174
194
175
- test_expect_success ' configuration To: header' '
195
+ test_expect_success ' configuration To: header (ascii)' '
196
+
197
+ git config format.to "R E Cipient <[email protected] >" &&
198
+ git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 &&
199
+ grep "^To: R E Cipient <[email protected] >\$" patch9
200
+ '
201
+
202
+ test_expect_failure ' configuration To: header (rfc822)' '
176
203
177
204
git config format.to "R. E. Cipient <[email protected] >" &&
178
205
git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 &&
179
- grep "^To: R. E. Cipient <[email protected] >\$" patch9
206
+ grep "^To: "R. E. Cipient" <[email protected] >\$" patch9
207
+ '
208
+
209
+ test_expect_failure ' configuration To: header (rfc2047)' '
210
+
211
+ git config format.to "R Ä Cipient <[email protected] >" &&
212
+ git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 &&
213
+ grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <[email protected] >\$" patch9
180
214
'
181
215
182
216
# check_patch <patch>: Verify that <patch> looks like a half-sane
@@ -190,11 +224,11 @@ check_patch () {
190
224
test_expect_success ' --no-to overrides config.to' '
191
225
192
226
git config --replace-all format.to \
193
- "R. E. Cipient <[email protected] >" &&
227
+ "R E Cipient <[email protected] >" &&
194
228
git format-patch --no-to --stdout master..side |
195
229
sed -e "/^\$/q" >patch10 &&
196
230
check_patch patch10 &&
197
- ! grep "^To: R. E. Cipient <[email protected] >\$" patch10
231
+ ! grep "^To: R E Cipient <[email protected] >\$" patch10
198
232
'
199
233
200
234
test_expect_success ' --no-to and --to replaces config.to' '
@@ -212,21 +246,21 @@ test_expect_success '--no-to and --to replaces config.to' '
212
246
test_expect_success ' --no-cc overrides config.cc' '
213
247
214
248
git config --replace-all format.cc \
215
- "C. E. Cipient <[email protected] >" &&
249
+ "C E Cipient <[email protected] >" &&
216
250
git format-patch --no-cc --stdout master..side |
217
251
sed -e "/^\$/q" >patch12 &&
218
252
check_patch patch12 &&
219
- ! grep "^Cc: C. E. Cipient <[email protected] >\$" patch12
253
+ ! grep "^Cc: C E Cipient <[email protected] >\$" patch12
220
254
'
221
255
222
256
test_expect_success ' --no-add-header overrides config.headers' '
223
257
224
258
git config --replace-all format.headers \
225
- "Header1: B. E. Cipient <[email protected] >" &&
259
+ "Header1: B E Cipient <[email protected] >" &&
226
260
git format-patch --no-add-header --stdout master..side |
227
261
sed -e "/^\$/q" >patch13 &&
228
262
check_patch patch13 &&
229
- ! grep "^Header1: B. E. Cipient <[email protected] >\$" patch13
263
+ ! grep "^Header1: B E Cipient <[email protected] >\$" patch13
230
264
'
231
265
232
266
test_expect_success ' multiple files' '
0 commit comments