251
check_encoding 2 8859
252
'
253
254
+test_expect_success 'am (U/U)' '
255
+ # Apply UTF-8 patches with UTF-8 commitencoding
256
+ git config i18n.commitencoding UTF-8 &&
257
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
258
+
259
+ git reset --hard master &&
260
+ git am out-u1 out-u2 &&
261
+
262
+ check_encoding 2
263
+'
264
+
265
+test_expect_success !MINGW 'am (L/L)' '
266
+ # Apply ISO-8859-1 patches with ISO-8859-1 commitencoding
267
+ git config i18n.commitencoding ISO8859-1 &&
268
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
269
+
270
+ git reset --hard master &&
271
+ git am out-l1 out-l2 &&
272
+
273
+ check_encoding 2 8859
274
+'
275
+
276
+test_expect_success 'am (U/L)' '
277
+ # Apply ISO-8859-1 patches with UTF-8 commitencoding
278
+ git config i18n.commitencoding UTF-8 &&
279
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
280
+ git reset --hard master &&
281
+
282
+ # am specifies --utf8 by default.
283
+ git am out-l1 out-l2 &&
284
+
285
+ check_encoding 2
286
+'
287
+
288
+test_expect_success 'am --no-utf8 (U/L)' '
289
+ # Apply ISO-8859-1 patches with UTF-8 commitencoding
290
+ git config i18n.commitencoding UTF-8 &&
291
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
292
+
293
+ git reset --hard master &&
294
+ git am --no-utf8 out-l1 out-l2 2>err &&
295
+
296
+ # commit-tree will warn that the commit message does not contain valid UTF-8
297
+ # as mailinfo did not convert it
298
+ grep "did not conform" err &&
299
+
300
+ check_encoding 2
301
+'
302
+
303
+test_expect_success !MINGW 'am (L/U)' '
304
+ # Apply UTF-8 patches with ISO-8859-1 commitencoding
305
+ git config i18n.commitencoding ISO8859-1 &&
306
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
307
+
308
+ git reset --hard master &&
309
+ # mailinfo will re-code the commit message to the charset specified by
310
+ # i18n.commitencoding
311
+ git am out-u1 out-u2 &&
312
+
313
+ check_encoding 2 8859
314
+'
315
+
316
test_done