3 test_description
='test subject preservation with format-patch | am'
5 TEST_PASSES_SANITIZE_LEAK
=true
11 test_expect_success
"create patches with $type subject" '
12 git reset --hard baseline &&
14 git commit -a -m "$subject" &&
15 git format-patch -1 --stdout >$type.patch &&
16 git format-patch -1 --stdout -k >$type-k.patch
21 git
reset --hard baseline
&&
23 git log
-1 --pretty=format
:%B
>actual
&&
24 test_cmp expect actual
27 test_expect_success
'setup baseline commit' '
28 test_commit baseline file
31 SHORT_SUBJECT
='short subject'
32 make_patches short
"$SHORT_SUBJECT"
34 LONG_SUBJECT1
='this is a long subject that is virtually guaranteed'
35 LONG_SUBJECT2
='to require wrapping via format-patch if it is all'
36 LONG_SUBJECT3
='going to appear on a single line'
37 LONG_SUBJECT
="$LONG_SUBJECT1 $LONG_SUBJECT2 $LONG_SUBJECT3"
38 make_patches long
"$LONG_SUBJECT"
40 MULTILINE_SUBJECT
="$LONG_SUBJECT1
43 make_patches multiline
"$MULTILINE_SUBJECT"
45 echo "$SHORT_SUBJECT" >expect
46 test_expect_success
'short subject preserved (format-patch | am)' '
49 test_expect_success
'short subject preserved (format-patch -k | am)' '
52 test_expect_success
'short subject preserved (format-patch -k | am -k)' '
53 check_subject short-k -k
56 echo "$LONG_SUBJECT" >expect
57 test_expect_success
'long subject preserved (format-patch | am)' '
60 test_expect_success
'long subject preserved (format-patch -k | am)' '
63 test_expect_success
'long subject preserved (format-patch -k | am -k)' '
64 check_subject long-k -k
67 echo "$LONG_SUBJECT" >expect
68 test_expect_success
'multiline subject unwrapped (format-patch | am)' '
69 check_subject multiline
71 test_expect_success
'multiline subject unwrapped (format-patch -k | am)' '
72 check_subject multiline-k
74 echo "$MULTILINE_SUBJECT" >expect
75 test_expect_success
'multiline subject preserved (format-patch -k | am -k)' '
76 check_subject multiline-k -k