@@ -738,61 +738,40 @@ test_expect_success 'set up trailers for next test' '
738
738
'
739
739
740
740
test_expect_success ' %(trailers:unfold) unfolds trailers' '
741
- git for-each-ref --format="%(trailers:unfold)" refs/heads/master >actual &&
742
741
{
743
742
unfold <trailers
744
743
echo
745
744
} >expect &&
745
+ git for-each-ref --format="%(trailers:unfold)" refs/heads/master >actual &&
746
+ test_cmp expect actual &&
747
+ git for-each-ref --format="%(contents:trailers:unfold)" refs/heads/master >actual &&
746
748
test_cmp expect actual
747
749
'
748
750
749
751
test_expect_success ' %(trailers:only) shows only "key: value" trailers' '
750
- git for-each-ref --format="%(trailers:only)" refs/heads/master >actual &&
751
752
{
752
753
grep -v patch.description <trailers &&
753
754
echo
754
755
} >expect &&
756
+ git for-each-ref --format="%(trailers:only)" refs/heads/master >actual &&
757
+ test_cmp expect actual &&
758
+ git for-each-ref --format="%(contents:trailers:only)" refs/heads/master >actual &&
755
759
test_cmp expect actual
756
760
'
757
761
758
762
test_expect_success ' %(trailers:only) and %(trailers:unfold) work together' '
759
- git for-each-ref --format="%(trailers:only,unfold)" refs/heads/master >actual &&
760
- git for-each-ref --format="%(trailers:unfold,only)" refs/heads/master >reverse &&
761
- test_cmp actual reverse &&
762
763
{
763
764
grep -v patch.description <trailers | unfold &&
764
765
echo
765
766
} >expect &&
766
- test_cmp expect actual
767
- '
768
-
769
- test_expect_success ' %(contents:trailers:unfold) unfolds trailers' '
770
- git for-each-ref --format="%(contents:trailers:unfold)" refs/heads/master >actual &&
771
- {
772
- unfold <trailers
773
- echo
774
- } >expect &&
775
- test_cmp expect actual
776
- '
777
-
778
- test_expect_success ' %(contents:trailers:only) shows only "key: value" trailers' '
779
- git for-each-ref --format="%(contents:trailers:only)" refs/heads/master >actual &&
780
- {
781
- grep -v patch.description <trailers &&
782
- echo
783
- } >expect &&
784
- test_cmp expect actual
785
- '
786
-
787
- test_expect_success ' %(contents:trailers:only) and %(contents:trailers:unfold) work together' '
767
+ git for-each-ref --format="%(trailers:only,unfold)" refs/heads/master >actual &&
768
+ test_cmp expect actual &&
769
+ git for-each-ref --format="%(trailers:unfold,only)" refs/heads/master >actual &&
770
+ test_cmp actual actual &&
788
771
git for-each-ref --format="%(contents:trailers:only,unfold)" refs/heads/master >actual &&
789
- git for-each-ref --format="%(contents:trailers:unfold,only)" refs/heads/master >reverse &&
790
- test_cmp actual reverse &&
791
- {
792
- grep -v patch.description <trailers | unfold &&
793
- echo
794
- } >expect &&
795
- test_cmp expect actual
772
+ test_cmp expect actual &&
773
+ git for-each-ref --format="%(contents:trailers:unfold,only)" refs/heads/master >actual &&
774
+ test_cmp actual actual
796
775
'
797
776
798
777
test_expect_success ' %(trailers) rejects unknown trailers arguments' '
@@ -801,14 +780,7 @@ test_expect_success '%(trailers) rejects unknown trailers arguments' '
801
780
fatal: unknown %(trailers) argument: unsupported
802
781
EOF
803
782
test_must_fail git for-each-ref --format="%(trailers:unsupported)" 2>actual &&
804
- test_i18ncmp expect actual
805
- '
806
-
807
- test_expect_success ' %(contents:trailers) rejects unknown trailers arguments' '
808
- # error message cannot be checked under i18n
809
- cat >expect <<-EOF &&
810
- fatal: unknown %(trailers) argument: unsupported
811
- EOF
783
+ test_i18ncmp expect actual &&
812
784
test_must_fail git for-each-ref --format="%(contents:trailers:unsupported)" 2>actual &&
813
785
test_i18ncmp expect actual
814
786
'
0 commit comments