summaryrefslogtreecommitdiff
path: root/t/t7513-interpret-trailers.sh
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2016-10-21 17:55:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-10-21 18:48:35 (GMT)
commitc463a6b28023dd3ad7ad4542147e20c27dbc83d6 (patch)
tree86aef84aedfa56c587b2480081f3b442ce3b2e3d /t/t7513-interpret-trailers.sh
parent146245063e286d5a38b146bd5a38da958bd3957b (diff)
downloadgit-c463a6b28023dd3ad7ad4542147e20c27dbc83d6.zip
git-c463a6b28023dd3ad7ad4542147e20c27dbc83d6.tar.gz
git-c463a6b28023dd3ad7ad4542147e20c27dbc83d6.tar.bz2
trailer: forbid leading whitespace in trailers
Currently, interpret-trailers allows leading whitespace in trailer lines. This leads to false positives, especially for quoted lines or bullet lists. Forbid leading whitespace in trailers. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7513-interpret-trailers.sh')
-rwxr-xr-xt/t7513-interpret-trailers.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh
index 003e90f..3d94b3a 100755
--- a/t/t7513-interpret-trailers.sh
+++ b/t/t7513-interpret-trailers.sh
@@ -241,6 +241,21 @@ test_expect_success 'with non-trailer lines only' '
test_cmp expected actual
'
+test_expect_success 'line with leading whitespace is not trailer' '
+ q_to_tab >patch <<-\EOF &&
+
+ Qtoken: value
+ EOF
+ q_to_tab >expected <<-\EOF &&
+
+ Qtoken: value
+
+ token: value
+ EOF
+ git interpret-trailers --trailer "token: value" patch >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'with config setup' '
git config trailer.ack.key "Acked-by: " &&
cat >expected <<-\EOF &&