summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2017-08-15 06:23:25 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-08-15 11:13:58 -0700
commitfdbdb64f49959f9c83329554080934895f02ae59 (patch)
treeed63c6ef71dd06f61b3d2abe2f08a9f667de7381 /t
parentinterpret-trailers: add an option to show only the trailers (diff)
downloadtgif-fdbdb64f49959f9c83329554080934895f02ae59.tar.xz
interpret-trailers: add an option to show only existing trailers
It can be useful to invoke interpret-trailers for the primary purpose of parsing existing trailers. But in that case, we don't want to apply existing ifMissing or ifExists rules from the config. Let's add a special mode where we avoid applying those rules. Coupled with --only-trailers, this gives us a reasonable parsing tool. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7513-interpret-trailers.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh
index 90d30037b7..94b6c52473 100755
--- a/t/t7513-interpret-trailers.sh
+++ b/t/t7513-interpret-trailers.sh
@@ -1314,4 +1314,20 @@ test_expect_success 'only-trailers omits non-trailer in middle of block' '
test_cmp expected actual
'
+test_expect_success 'only input' '
+ git config trailer.sign.command "echo config-value" &&
+ cat >expected <<-\EOF &&
+ existing: existing-value
+ EOF
+ git interpret-trailers \
+ --only-trailers --only-input >actual <<-\EOF &&
+ my subject
+
+ my body
+
+ existing: existing-value
+ EOF
+ test_cmp expected actual
+'
+
test_done