summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-09-03 19:18:03 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-09-03 19:18:03 -0700
commit9d939886dbea58cf779f53f4c7b246a6562e184e (patch)
tree59334f9d972c1f16435df255f258bed1be00304a /t
parentMerge branch 'dt/commit-preserve-base-index-upon-opportunistic-cache-tree-upd... (diff)
parenttrailer: support multiline title (diff)
downloadtgif-9d939886dbea58cf779f53f4c7b246a6562e184e.tar.xz
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 bd0ab46750..322c436a49 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 &&