summaryrefslogtreecommitdiff
path: root/t/t6300-for-each-ref.sh
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2017-10-02 05:25:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-02 06:36:27 (GMT)
commit624b44d3763bd10e51fdcf66a205535140ca8539 (patch)
tree2e8762502baf0d0ce274cab7d4922917dfeb212d /t/t6300-for-each-ref.sh
parentced1f08b7b0b625a3ce21185573c80e7ada1e3fa (diff)
downloadgit-624b44d3763bd10e51fdcf66a205535140ca8539.zip
git-624b44d3763bd10e51fdcf66a205535140ca8539.tar.gz
git-624b44d3763bd10e51fdcf66a205535140ca8539.tar.bz2
t6300: refactor %(trailers) tests
We currently have one test for %(trailers) in `git-for-each-ref(1)`, through "%(contents:trailers)". In preparation for more, let's add a few things: - Move the commit creation step to its own test so that it can be re-used. - Add a non-trailer to the commit's trailers to test that non-trailers aren't shown using "%(trailers:only)". - Add a multi-line trailer to ensure that trailers are unfolded correctly using "%(trailers:unfold)". Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6300-for-each-ref.sh')
-rwxr-xr-xt/t6300-for-each-ref.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 2274a4b..3943190 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -605,18 +605,25 @@ test_expect_success 'do not dereference NULL upon %(HEAD) on unborn branch' '
cat >trailers <<EOF
Reviewed-by: A U Thor <author@example.com>
Signed-off-by: A U Thor <author@example.com>
+[ v2 updated patch description ]
+Acked-by: A U Thor
+ <author@example.com>
EOF
-test_expect_success 'basic atom: head contents:trailers' '
+
+test_expect_success 'set up trailers for next test' '
echo "Some contents" > two &&
git add two &&
- git commit -F - <<-EOF &&
+ git commit -F - <<-EOF
trailers: this commit message has trailers
Some message contents
$(cat trailers)
EOF
+'
+
+test_expect_success 'basic atom: head contents:trailers' '
git for-each-ref --format="%(contents:trailers)" refs/heads/master >actual &&
sanitize_pgp <actual >actual.clean &&
# git for-each-ref ends with a blank line