]>
git.ipfire.org Git - thirdparty/git.git/blob - t/t4152-am-subjects.sh
3 test_description
='test subject preservation with format-patch | am'
9 test_expect_success
"create patches with $type subject" '
10 git reset --hard baseline &&
12 git commit -a -m "$subject" &&
13 git format-patch -1 --stdout >$type.patch &&
14 git format-patch -1 --stdout -k >$type-k.patch
19 git
reset --hard baseline
&&
21 git log
-1 --pretty=format
:%B
>actual
&&
22 test_cmp expect actual
25 test_expect_success
'setup baseline commit' '
26 test_commit baseline file
29 SHORT_SUBJECT
='short subject'
30 make_patches short
"$SHORT_SUBJECT"
32 LONG_SUBJECT1
='this is a long subject that is virtually guaranteed'
33 LONG_SUBJECT2
='to require wrapping via format-patch if it is all'
34 LONG_SUBJECT3
='going to appear on a single line'
35 LONG_SUBJECT
="$LONG_SUBJECT1 $LONG_SUBJECT2 $LONG_SUBJECT3"
36 make_patches long
"$LONG_SUBJECT"
38 MULTILINE_SUBJECT
="$LONG_SUBJECT1
41 make_patches multiline
"$MULTILINE_SUBJECT"
43 echo "$SHORT_SUBJECT" >expect
44 test_expect_success
'short subject preserved (format-patch | am)' '
47 test_expect_success
'short subject preserved (format-patch -k | am)' '
50 test_expect_success
'short subject preserved (format-patch -k | am -k)' '
51 check_subject short-k -k
54 echo "$LONG_SUBJECT" >expect
55 test_expect_success
'long subject preserved (format-patch | am)' '
58 test_expect_success
'long subject preserved (format-patch -k | am)' '
61 test_expect_success
'long subject preserved (format-patch -k | am -k)' '
62 check_subject long-k -k
65 echo "$LONG_SUBJECT" >expect
66 test_expect_success
'multiline subject unwrapped (format-patch | am)' '
67 check_subject multiline
69 test_expect_success
'multiline subject unwrapped (format-patch -k | am)' '
70 check_subject multiline-k
72 echo "$MULTILINE_SUBJECT" >expect
73 test_expect_success
'multiline subject preserved (format-patch -k | am -k)' '
74 check_subject multiline-k -k