summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-04 02:18:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-04 02:18:03 (GMT)
commit9d939886dbea58cf779f53f4c7b246a6562e184e (patch)
tree59334f9d972c1f16435df255f258bed1be00304a /t
parent311e5ce2cc06f7bb640be62f487e5b3d14bbb9a0 (diff)
parent5c99995df8ee3b02224f0e2e86a3d1e4bb2f7348 (diff)
downloadgit-9d939886dbea58cf779f53f4c7b246a6562e184e.zip
git-9d939886dbea58cf779f53f4c7b246a6562e184e.tar.gz
git-9d939886dbea58cf779f53f4c7b246a6562e184e.tar.bz2
Merge branch 'cc/trailers-corner-case-fix' into maint
The "interpret-trailers" helper mistook a multi-paragraph title of a commit log message with a colon in it as the end of the trailer block. * cc/trailers-corner-case-fix: trailer: support multiline title trailer: retitle a test and correct an in-comment message trailer: ignore first line of message
Diffstat (limited to 't')
-rwxr-xr-xt/t7513-interpret-trailers.sh29
1 files changed, 28 insertions, 1 deletions
diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh
index bd0ab46..322c436 100755
--- a/t/t7513-interpret-trailers.sh
+++ b/t/t7513-interpret-trailers.sh
@@ -93,12 +93,39 @@ test_expect_success 'with config option on the command line' '
Acked-by: Johan
Reviewed-by: Peff
EOF
- echo "Acked-by: Johan" |
+ { echo; echo "Acked-by: Johan"; } |
git -c "trailer.Acked-by.ifexists=addifdifferent" interpret-trailers \
--trailer "Reviewed-by: Peff" --trailer "Acked-by: Johan" >actual &&
test_cmp expected actual
'
+test_expect_success 'with only a title in the message' '
+ cat >expected <<-\EOF &&
+ area: change
+
+ Reviewed-by: Peff
+ Acked-by: Johan
+ EOF
+ echo "area: change" |
+ git interpret-trailers --trailer "Reviewed-by: Peff" \
+ --trailer "Acked-by: Johan" >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'with multiline title in the message' '
+ cat >expected <<-\EOF &&
+ place of
+ code: change
+
+ Reviewed-by: Peff
+ Acked-by: Johan
+ EOF
+ printf "%s\n" "place of" "code: change" |
+ git interpret-trailers --trailer "Reviewed-by: Peff" \
+ --trailer "Acked-by: Johan" >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'with config setup' '
git config trailer.ack.key "Acked-by: " &&
cat >expected <<-\EOF &&