Skip to content

Commit 4fea72f

Browse files
SantiagoTorresgitster
authored andcommitted
t/t7004-tag: Add --format specifier tests
tag -v now supports --format specifiers to inspect the contents of a tag upon verification. Add two tests to ensure this behavior is respected in future changes. Signed-off-by: Santiago Torres <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 02c5433 commit 4fea72f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/t7004-tag.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,22 @@ test_expect_success GPG 'verifying a forged tag should fail' '
847847
test_must_fail git tag -v forged-tag
848848
'
849849

850+
test_expect_success 'verifying a proper tag with --format pass and format accordingly' '
851+
cat >expect <<-\EOF
852+
tagname : signed-tag
853+
EOF &&
854+
git tag -v --format="tagname : %(tag)" "signed-tag" >actual &&
855+
test_cmp expect actual
856+
'
857+
858+
test_expect_success 'verifying a forged tag with --format fail and format accordingly' '
859+
cat >expect <<-\EOF
860+
tagname : forged-tag
861+
EOF &&
862+
test_must_fail git tag -v --format="tagname : %(tag)" "forged-tag" >actual &&
863+
test_cmp expect actual
864+
'
865+
850866
# blank and empty messages for signed tags:
851867

852868
get_tag_header empty-signed-tag $commit commit $time >expect

0 commit comments

Comments
 (0)