{"thread":{"id":"8765","subject":"[PATCH] Add test-script for git-tag","startedAt":"2007-06-28T20:09:12Z","lastAt":"2007-06-29T04:41:36Z","messageCount":2,"participants":["Carlos Rica","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"45998","messageId":"46841568.8070203@gmail.com","threadId":"8765","inReplyTo":null,"subject":"[PATCH] Add test-script for git-tag","fromName":"Carlos Rica","fromEmail":"jasampler@gmail.com","sentAt":"2007-06-28T20:09:12Z","receivedAt":"2007-06-28T20:09:12Z","isPatch":true,"sender":{"key":"jasampler@gmail.com","avatar":null},"body":"These tests are useful to develop the C version for git-tag.sh,\nensuring that the future builtin-tag.c will not break previous\nbehaviour.\n\nThe tests are focused on listing, verifying, deleting and creating\ntags, checking always that the correct status value is returned\nand everything remains as expected.\n\nIn order to verify and create signed tags, a PGP key was also\nadded, being created this way: gpg --homedir t/t7004 --gen-key\nType DSA and Elgamal, size 2048 bits, no expiration date.\nName and email: C O Mitter <committer@example.com>\nNo password given, to enable non-interactive operation.\n\nSigned-off-by: Carlos Rica <jasampler@gmail.com>\n---\n\n   This patch has the changes that Junio suggested in:\n   http://article.gmane.org/gmane.comp.version-control.git/50286\n\n   Since random_seed would be regenerated by gpg when running\n   these tests, it is included, to prevent the tests from\n   stalling on entropy-weak machines.\n\n t/t7004-tag.sh      |  687 +++++++++++++++++++++++++++++++++++++++++++++++++++\n t/t7004/pubring.gpg |  Bin\n t/t7004/random_seed |  Bin\n t/t7004/secring.gpg |  Bin\n 4 files changed, 687 insertions(+), 0 deletions(-)\n create mode 100755 t/t7004-tag.sh\n create mode 100644 t/t7004/pubring.gpg\n create mode 100644 t/t7004/random_seed\n create mode 100644 t/t7004/secring.gpg\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nnew file mode 100755\nindex 0000000..a09adc6\n--- /dev/null\n+++ b/t/t7004-tag.sh\n@@ -0,0 +1,687 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Carlos Rica\n+#\n+\n+test_description='git-tag\n+\n+Basic tests for operations with tags.'\n+\n+. ./test-lib.sh\n+\n+# creating and listing lightweight tags:\n+\n+tag_exists () {\n+\tgit show-ref --quiet --verify refs/tags/\"$1\"\n+}\n+\n+# todo: git tag -l now returns always zero, when fixed, change this test\n+test_expect_success 'listing all tags in an empty tree should succeed' \\\n+\t'git tag -l'\n+\n+test_expect_success 'listing all tags in an empty tree should output nothing' \\\n+\t'test `git-tag -l | wc -l` -eq 0'\n+\n+test_expect_failure 'looking for a tag in an empty tree should fail' \\\n+\t'tag_exists mytag'\n+\n+test_expect_success 'creating a tag in an empty tree should fail' '\n+\t! git-tag mynotag &&\n+\t! tag_exists mynotag\n+'\n+\n+test_expect_success 'creating a tag for HEAD in an empty tree should fail' '\n+\t! git-tag mytaghead HEAD &&\n+\t! tag_exists mytaghead\n+'\n+\n+test_expect_success 'creating a tag for an unknown revision should fail' '\n+\t! git-tag mytagnorev aaaaaaaaaaa &&\n+\t! tag_exists mytagnorev\n+'\n+\n+# commit used in the tests, test_tick is also called here to freeze the date:\n+test_expect_success 'creating a tag using default HEAD should succeed' '\n+\ttest_tick &&\n+\techo foo >foo &&\n+\tgit add foo &&\n+\tgit commit -m Foo &&\n+\tgit tag mytag\n+'\n+\n+test_expect_success 'listing all tags if one exists should succeed' \\\n+\t'git-tag -l'\n+\n+test_expect_success 'listing all tags if one exists should output that tag' \\\n+\t'test `git-tag -l` = mytag'\n+\n+# pattern matching:\n+\n+test_expect_success 'listing a tag using a matching pattern should succeed' \\\n+\t'git-tag -l mytag'\n+\n+test_expect_success \\\n+\t'listing a tag using a matching pattern should output that tag' \\\n+\t'test `git-tag -l mytag` = mytag'\n+\n+# todo: git tag -l now returns always zero, when fixed, change this test\n+test_expect_success \\\n+\t'listing tags using a non-matching pattern should suceed' \\\n+\t'git-tag -l xxx'\n+\n+test_expect_success \\\n+\t'listing tags using a non-matching pattern should output nothing' \\\n+\t'test `git-tag -l xxx | wc -l` -eq 0'\n+\n+# special cases for creating tags:\n+\n+test_expect_failure \\\n+\t'trying to create a tag with the name of one existing should fail' \\\n+\t'git tag mytag'\n+\n+test_expect_success \\\n+\t'trying to create a tag with a non-valid name should fail' '\n+\ttest `git-tag -l | wc -l` -eq 1 &&\n+\t! git tag \"\" &&\n+\t! git tag .othertag &&\n+\t! git tag \"other tag\" &&\n+\t! git tag \"othertag^\" &&\n+\t! git tag \"other~tag\" &&\n+\ttest `git-tag -l | wc -l` -eq 1\n+'\n+\n+test_expect_success 'creating a tag using HEAD directly should succeed' '\n+\tgit tag myhead HEAD &&\n+\ttag_exists myhead\n+'\n+\n+# deleting tags:\n+\n+test_expect_success 'trying to delete an unknown tag should fail' '\n+\t! tag_exists unknown-tag &&\n+\t! git-tag -d unknown-tag\n+'\n+\n+cat >expect <<EOF\n+myhead\n+mytag\n+EOF\n+test_expect_success \\\n+\t'trying to delete tags without params should succeed and do nothing' '\n+\tgit tag -l > actual && git diff expect actual &&\n+\tgit-tag -d &&\n+\tgit tag -l > actual && git diff expect actual\n+'\n+\n+test_expect_success \\\n+\t'deleting two existing tags in one command should succeed' '\n+\ttag_exists mytag &&\n+\ttag_exists myhead &&\n+\tgit-tag -d mytag myhead &&\n+\t! tag_exists mytag &&\n+\t! tag_exists myhead\n+'\n+\n+test_expect_success \\\n+\t'creating a tag with the name of another deleted one should succeed' '\n+\t! tag_exists mytag &&\n+\tgit-tag mytag &&\n+\ttag_exists mytag\n+'\n+\n+test_expect_success \\\n+\t'trying to delete two tags, existing and not, should fail in the 2nd' '\n+\ttag_exists mytag &&\n+\t! tag_exists myhead &&\n+\t! git-tag -d mytag anothertag &&\n+\t! tag_exists mytag &&\n+\t! tag_exists myhead\n+'\n+\n+test_expect_failure 'trying to delete an already deleted tag should fail' \\\n+\t'git-tag -d mytag'\n+\n+# listing various tags with pattern matching:\n+\n+cat >expect <<EOF\n+a1\n+aa1\n+cba\n+t210\n+t211\n+v0.2.1\n+v1.0\n+v1.0.1\n+v1.1.3\n+EOF\n+test_expect_success 'listing all tags should print them ordered' '\n+\tgit tag v1.0.1 &&\n+\tgit tag t211 &&\n+\tgit tag aa1 &&\n+\tgit tag v0.2.1 &&\n+\tgit tag v1.1.3 &&\n+\tgit tag cba &&\n+\tgit tag a1 &&\n+\tgit tag v1.0 &&\n+\tgit tag t210 &&\n+\tgit tag -l > actual\n+\tgit diff expect actual\n+'\n+\n+cat >expect <<EOF\n+a1\n+aa1\n+cba\n+EOF\n+test_expect_success \\\n+\t'listing tags with substring as pattern must print those matching' '\n+\tgit-tag -l a > actual &&\n+\tgit-diff expect actual\n+'\n+\n+cat >expect <<EOF\n+v0.2.1\n+v1.0.1\n+v1.1.3\n+EOF\n+test_expect_success \\\n+\t'listing tags with substring as pattern must print those matching' '\n+\tgit-tag -l .1 > actual &&\n+\tgit-diff expect actual\n+'\n+\n+cat >expect <<EOF\n+t210\n+t211\n+EOF\n+test_expect_success \\\n+\t'listing tags with substring as pattern must print those matching' '\n+\tgit-tag -l t21 > actual &&\n+\tgit-diff expect actual\n+'\n+\n+cat >expect <<EOF\n+a1\n+aa1\n+EOF\n+test_expect_success \\\n+\t'listing tags using a name as pattern must print those matching' '\n+\tgit-tag -l a1 > actual &&\n+\tgit-diff expect actual\n+'\n+\n+cat >expect <<EOF\n+v1.0\n+v1.0.1\n+EOF\n+test_expect_success \\\n+\t'listing tags using a name as pattern must print those matching' '\n+\tgit-tag -l v1.0 > actual &&\n+\tgit-diff expect actual\n+'\n+\n+cat >expect <<EOF\n+v1.1.3\n+EOF\n+test_expect_success \\\n+\t'listing tags with ? in the pattern should print those matching' '\n+\tgit-tag -l \"1.1?\" > actual &&\n+\tgit-diff expect actual\n+'\n+\n+>expect\n+test_expect_success \\\n+\t'listing tags using v.* should print nothing because none have v.' '\n+\tgit-tag -l \"v.*\" > actual &&\n+\tgit-diff expect actual\n+'\n+\n+cat >expect <<EOF\n+v0.2.1\n+v1.0\n+v1.0.1\n+v1.1.3\n+EOF\n+test_expect_success \\\n+\t'listing tags using v* should print only those having v' '\n+\tgit-tag -l \"v*\" > actual &&\n+\tgit-diff expect actual\n+'\n+\n+# creating and verifying lightweight tags:\n+\n+test_expect_success \\\n+\t'a non-annotated tag created without parameters should point to HEAD' '\n+\tgit-tag non-annotated-tag &&\n+\ttest $(git-cat-file -t non-annotated-tag) = commit &&\n+\ttest $(git-rev-parse non-annotated-tag) = $(git-rev-parse HEAD)\n+'\n+\n+test_expect_failure 'trying to verify an unknown tag should fail' \\\n+\t'git-tag -v unknown-tag'\n+\n+test_expect_failure \\\n+\t'trying to verify a non-annotated and non-signed tag should fail' \\\n+\t'git-tag -v non-annotated-tag'\n+\n+# creating annotated tags:\n+\n+get_tag_msg () {\n+\tgit cat-file tag \"$1\" | sed -e \"/BEGIN PGP/q\"\n+}\n+\n+# run test_tick before committing always gives the time in that timezone\n+get_tag_header () {\n+cat <<EOF\n+object $2\n+type $3\n+tag $1\n+tagger C O Mitter <committer@example.com> $4 -0700\n+\n+EOF\n+}\n+\n+commit=$(git rev-parse HEAD)\n+time=$test_tick\n+\n+get_tag_header annotated-tag $commit commit $time >expect\n+echo \"A message\" >>expect\n+test_expect_success \\\n+\t'creating an annotated tag with -m message should succeed' '\n+\tgit-tag -m \"A message\" annotated-tag &&\n+\tget_tag_msg annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+cat >msgfile <<EOF\n+Another message\n+in a file.\n+EOF\n+get_tag_header file-annotated-tag $commit commit $time >expect\n+cat msgfile >>expect\n+test_expect_success \\\n+\t'creating an annotated tag with -F messagefile should succeed' '\n+\tgit-tag -F msgfile file-annotated-tag &&\n+\tget_tag_msg file-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+# blank and empty messages:\n+\n+get_tag_header empty-annotated-tag $commit commit $time >expect\n+test_expect_success \\\n+\t'creating a tag with an empty -m message should succeed' '\n+\tgit-tag -m \"\" empty-annotated-tag &&\n+\tget_tag_msg empty-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+>emptyfile\n+get_tag_header emptyfile-annotated-tag $commit commit $time >expect\n+test_expect_success \\\n+\t'creating a tag with an empty -F messagefile should succeed' '\n+\tgit-tag -F emptyfile emptyfile-annotated-tag &&\n+\tget_tag_msg emptyfile-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+printf '\\n\\n  \\n\\t\\nLeading blank lines\\n' >blanksfile\n+printf '\\n\\t \\t  \\nRepeated blank lines\\n' >>blanksfile\n+printf '\\n\\n\\nTrailing spaces      \\t  \\n' >>blanksfile\n+printf '\\nTrailing blank lines\\n\\n\\t \\n\\n' >>blanksfile\n+get_tag_header blanks-annotated-tag $commit commit $time >expect\n+cat >>expect <<EOF\n+Leading blank lines\n+\n+Repeated blank lines\n+\n+Trailing spaces\n+\n+Trailing blank lines\n+EOF\n+test_expect_success \\\n+\t'extra blanks in the message for an annotated tag should be removed' '\n+\tgit-tag -F blanksfile blanks-annotated-tag &&\n+\tget_tag_msg blanks-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+get_tag_header blank-annotated-tag $commit commit $time >expect\n+test_expect_success \\\n+\t'creating a tag with blank -m message with spaces should succeed' '\n+\tgit-tag -m \"     \" blank-annotated-tag &&\n+\tget_tag_msg blank-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+echo '     ' >blankfile\n+echo ''      >>blankfile\n+echo '  '    >>blankfile\n+get_tag_header blankfile-annotated-tag $commit commit $time >expect\n+test_expect_success \\\n+\t'creating a tag with blank -F messagefile with spaces should succeed' '\n+\tgit-tag -F blankfile blankfile-annotated-tag &&\n+\tget_tag_msg blankfile-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+printf '      ' >blanknonlfile\n+get_tag_header blanknonlfile-annotated-tag $commit commit $time >expect\n+test_expect_success \\\n+\t'creating a tag with -F file of spaces and no newline should succeed' '\n+\tgit-tag -F blanknonlfile blanknonlfile-annotated-tag &&\n+\tget_tag_msg blanknonlfile-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+# messages with commented lines:\n+\n+cat >commentsfile <<EOF\n+# A comment\n+\n+############\n+The message.\n+############\n+One line.\n+\n+\n+# commented lines\n+# commented lines\n+\n+Another line.\n+# comments\n+\n+Last line.\n+EOF\n+get_tag_header comments-annotated-tag $commit commit $time >expect\n+cat >>expect <<EOF\n+The message.\n+One line.\n+\n+Another line.\n+\n+Last line.\n+EOF\n+test_expect_success \\\n+\t'creating a tag using a -F messagefile with #comments should succeed' '\n+\tgit-tag -F commentsfile comments-annotated-tag &&\n+\tget_tag_msg comments-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+get_tag_header comment-annotated-tag $commit commit $time >expect\n+test_expect_success \\\n+\t'creating a tag with a #comment in the -m message should succeed' '\n+\tgit-tag -m \"#comment\" comment-annotated-tag &&\n+\tget_tag_msg comment-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+echo '#comment' >commentfile\n+echo ''         >>commentfile\n+echo '####'     >>commentfile\n+get_tag_header commentfile-annotated-tag $commit commit $time >expect\n+test_expect_success \\\n+\t'creating a tag with #comments in the -F messagefile should succeed' '\n+\tgit-tag -F commentfile commentfile-annotated-tag &&\n+\tget_tag_msg commentfile-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+printf '#comment' >commentnonlfile\n+get_tag_header commentnonlfile-annotated-tag $commit commit $time >expect\n+test_expect_success \\\n+\t'creating a tag with a file of #comment and no newline should succeed' '\n+\tgit-tag -F commentnonlfile commentnonlfile-annotated-tag &&\n+\tget_tag_msg commentnonlfile-annotated-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+# trying to verify annotated non-signed tags:\n+\n+test_expect_success \\\n+\t'trying to verify an annotated non-signed tag should fail' '\n+\ttag_exists annotated-tag &&\n+\t! git-tag -v annotated-tag\n+'\n+\n+test_expect_success \\\n+\t'trying to verify a file-annotated non-signed tag should fail' '\n+\ttag_exists file-annotated-tag &&\n+\t! git-tag -v file-annotated-tag\n+'\n+\n+# creating and verifying signed tags:\n+\n+gpg --version >/dev/null\n+if [ $? -eq 127 ]; then\n+\techo \"Skipping signed tags tests, because gpg was not found\"\n+\ttest_done\n+\texit\n+fi\n+\n+# key generation info: gpg --homedir t/t7004 --gen-key\n+# Type DSA and Elgamal, size 2048 bits, no expiration date.\n+# Name and email: C O Mitter <committer@example.com>\n+# No password given, to enable non-interactive operation.\n+\n+cp -R ../t7004 ./gpghome\n+chmod 0700 gpghome\n+export GNUPGHOME=\"$(pwd)/gpghome\"\n+\n+get_tag_header signed-tag $commit commit $time >expect\n+echo 'A signed tag message' >>expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success 'creating a signed tag with -m message should succeed' '\n+\tgit-tag -s -m \"A signed tag message\" signed-tag &&\n+\tget_tag_msg signed-tag >actual &&\n+\tgit-diff expect actual\n+'\n+\n+test_expect_success 'verifying a signed tag should succeed' \\\n+\t'git-tag -v signed-tag'\n+\n+test_expect_success 'verifying a forged tag should fail' '\n+\tforged=$(git cat-file tag signed-tag |\n+\t\tsed -e \"s/signed-tag/forged-tag/\" |\n+\t\tgit mktag) &&\n+\tgit tag forged-tag $forged &&\n+\t! git-tag -v forged-tag\n+'\n+\n+# blank and empty messages for signed tags:\n+\n+get_tag_header empty-signed-tag $commit commit $time >expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag with an empty -m message should succeed' '\n+\tgit-tag -s -m \"\" empty-signed-tag &&\n+\tget_tag_msg empty-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v empty-signed-tag\n+'\n+\n+>sigemptyfile\n+get_tag_header emptyfile-signed-tag $commit commit $time >expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag with an empty -F messagefile should succeed' '\n+\tgit-tag -s -F sigemptyfile emptyfile-signed-tag &&\n+\tget_tag_msg emptyfile-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v emptyfile-signed-tag\n+'\n+\n+printf '\\n\\n  \\n\\t\\nLeading blank lines\\n' > sigblanksfile\n+printf '\\n\\t \\t  \\nRepeated blank lines\\n' >>sigblanksfile\n+printf '\\n\\n\\nTrailing spaces      \\t  \\n' >>sigblanksfile\n+printf '\\nTrailing blank lines\\n\\n\\t \\n\\n' >>sigblanksfile\n+get_tag_header blanks-signed-tag $commit commit $time >expect\n+cat >>expect <<EOF\n+Leading blank lines\n+\n+Repeated blank lines\n+\n+Trailing spaces\n+\n+Trailing blank lines\n+EOF\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'extra blanks in the message for a signed tag should be removed' '\n+\tgit-tag -s -F sigblanksfile blanks-signed-tag &&\n+\tget_tag_msg blanks-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v blanks-signed-tag\n+'\n+\n+get_tag_header blank-signed-tag $commit commit $time >expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag with a blank -m message should succeed' '\n+\tgit-tag -s -m \"     \" blank-signed-tag &&\n+\tget_tag_msg blank-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v blank-signed-tag\n+'\n+\n+echo '     ' >sigblankfile\n+echo ''      >>sigblankfile\n+echo '  '    >>sigblankfile\n+get_tag_header blankfile-signed-tag $commit commit $time >expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag with blank -F file with spaces should succeed' '\n+\tgit-tag -s -F sigblankfile blankfile-signed-tag &&\n+\tget_tag_msg blankfile-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v blankfile-signed-tag\n+'\n+\n+printf '      ' >sigblanknonlfile\n+get_tag_header blanknonlfile-signed-tag $commit commit $time >expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag with spaces and no newline should succeed' '\n+\tgit-tag -s -F sigblanknonlfile blanknonlfile-signed-tag &&\n+\tget_tag_msg blanknonlfile-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v signed-tag\n+'\n+\n+# messages with commented lines for signed tags:\n+\n+cat >sigcommentsfile <<EOF\n+# A comment\n+\n+############\n+The message.\n+############\n+One line.\n+\n+\n+# commented lines\n+# commented lines\n+\n+Another line.\n+# comments\n+\n+Last line.\n+EOF\n+get_tag_header comments-signed-tag $commit commit $time >expect\n+cat >>expect <<EOF\n+The message.\n+One line.\n+\n+Another line.\n+\n+Last line.\n+EOF\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag with a -F file with #comments should succeed' '\n+\tgit-tag -s -F sigcommentsfile comments-signed-tag &&\n+\tget_tag_msg comments-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v comments-signed-tag\n+'\n+\n+get_tag_header comment-signed-tag $commit commit $time >expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag with #commented -m message should succeed' '\n+\tgit-tag -s -m \"#comment\" comment-signed-tag &&\n+\tget_tag_msg comment-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v comment-signed-tag\n+'\n+\n+echo '#comment' >sigcommentfile\n+echo ''         >>sigcommentfile\n+echo '####'     >>sigcommentfile\n+get_tag_header commentfile-signed-tag $commit commit $time >expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag with #commented -F messagefile should succeed' '\n+\tgit-tag -s -F sigcommentfile commentfile-signed-tag &&\n+\tget_tag_msg commentfile-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v commentfile-signed-tag\n+'\n+\n+printf '#comment' >sigcommentnonlfile\n+get_tag_header commentnonlfile-signed-tag $commit commit $time >expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag with a #comment and no newline should succeed' '\n+\tgit-tag -s -F sigcommentnonlfile commentnonlfile-signed-tag &&\n+\tget_tag_msg commentnonlfile-signed-tag >actual &&\n+\tgit diff expect actual &&\n+\tgit-tag -v commentnonlfile-signed-tag\n+'\n+\n+# tags pointing to objects different from commits:\n+\n+tree=$(git rev-parse HEAD^{tree})\n+blob=$(git rev-parse HEAD:foo)\n+tag=$(git rev-parse signed-tag)\n+\n+get_tag_header tree-signed-tag $tree tree $time >expect\n+echo \"A message for a tree\" >>expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag pointing to a tree should succeed' '\n+\tgit-tag -s -m \"A message for a tree\" tree-signed-tag HEAD^{tree} &&\n+\tget_tag_msg tree-signed-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+get_tag_header blob-signed-tag $blob blob $time >expect\n+echo \"A message for a blob\" >>expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag pointing to a blob should succeed' '\n+\tgit-tag -s -m \"A message for a blob\" blob-signed-tag HEAD:foo &&\n+\tget_tag_msg blob-signed-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+get_tag_header tag-signed-tag $tag tag $time >expect\n+echo \"A message for another tag\" >>expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success \\\n+\t'creating a signed tag pointing to another tag should succeed' '\n+\tgit-tag -s -m \"A message for another tag\" tag-signed-tag signed-tag &&\n+\tget_tag_msg tag-signed-tag >actual &&\n+\tgit diff expect actual\n+'\n+\n+# try to verify without gpg:\n+\n+rm -rf gpghome\n+test_expect_failure \\\n+\t'verify signed tag fails when public key is not present' \\\n+\t'git-tag -v signed-tag'\n+\n+test_done\n+\ndiff --git a/t/t7004/pubring.gpg b/t/t7004/pubring.gpg\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..83855fa4e1c6c37afe550c17afa1e7971042ded5\nGIT binary patch\nliteral 1164\nzc$@)@1ateD0ipy(XUi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!d*h2?YX1XUk3k8w>yn2@n&u^&ZXMLk+>~\nz0HDxvfGrJTMY@$ys#k#t?D63Zq=W#R3eUeT(L61`VGHe?zP;`rnta#-umS)8nA%Rq\n\nliteral 0\nHc$@<O00001\n\n-- \n1.5.0\n"},{"id":"46020","messageId":"7vd4zfid8f.fsf@assigned-by-dhcp.pobox.com","threadId":"8765","inReplyTo":"46841568.8070203@gmail.com","subject":"Re: [PATCH] Add test-script for git-tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-29T04:41:36Z","receivedAt":"2007-06-29T04:41:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}