diff options
author | Jacob Keller <jacob.keller@gmail.com> | 2016-11-18 16:58:15 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-12-11 13:58:41 -0800 |
commit | b1d31c8954f9c21b275f4fb7d872414b564c201c (patch) | |
tree | 58a8f8d36a5f9331a0e393e086f447ad65047af7 /t/t6300-for-each-ref.sh | |
parent | d9f31fbfe98e0e363a3c69aaf6badecc746afe6b (diff) | |
download | git-b1d31c8954f9c21b275f4fb7d872414b564c201c.tar.gz git-b1d31c8954f9c21b275f4fb7d872414b564c201c.tar.xz |
ref-filter: add support to display trailers as part of contents
Add %(trailers) and %(contents:trailers) to display the trailers as
interpreted by trailer_info_get. Update documentation and add a test for
the new feature.
Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6300-for-each-ref.sh')
-rwxr-xr-x | t/t6300-for-each-ref.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index 19a282302..eb4bac0fe 100755 --- a/t/t6300-for-each-ref.sh +++ b/t/t6300-for-each-ref.sh @@ -553,4 +553,30 @@ test_expect_success 'Verify sort with multiple keys' ' refs/tags/bogo refs/tags/master > actual && test_cmp expected actual ' + +cat >trailers <<EOF +Reviewed-by: A U Thor <author@example.com> +Signed-off-by: A U Thor <author@example.com> +EOF + +test_expect_success 'basic atom: head contents:trailers' ' + echo "Some contents" > two && + git add two && + git commit -F - <<-EOF && + trailers: this commit message has trailers + + Some message contents + + $(cat trailers) + EOF + 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 + cat >expect <<-EOF && + $(cat trailers) + + EOF + test_cmp expect actual.clean +' + test_done |