X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7004-tag.sh;h=0d07bc39c745ade65370dde35f43f16a37231179;hb=d8b3a2bf189a9e7fea76454157b77fa71c9abc05;hp=a0be1646194ef7248184bfaf764bb8cc3b0eadb8;hpb=62e09ce998dd7f6b844deb650101c743a5c4ce50;p=git.git diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index a0be16461..0d07bc39c 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -185,18 +185,17 @@ cba EOF test_expect_success \ 'listing tags with substring as pattern must print those matching' ' - git-tag -l a > actual && + git-tag -l "*a*" > actual && git diff expect actual ' cat >expect < actual && + 'listing tags with a suffix as pattern must print those matching' ' + git-tag -l "*.1" > actual && git diff expect actual ' @@ -205,37 +204,36 @@ t210 t211 EOF test_expect_success \ - 'listing tags with substring as pattern must print those matching' ' - git-tag -l t21 > actual && + 'listing tags with a prefix as pattern must print those matching' ' + git-tag -l "t21*" > actual && git diff expect actual ' cat >expect < actual && git diff expect actual ' cat >expect < actual && git diff expect actual ' cat >expect < actual && + git-tag -l "v1.?.?" > actual && git diff expect actual ' @@ -332,6 +330,33 @@ test_expect_success 'creating an annotated tag with -F - should succeed' ' git diff expect actual ' +test_expect_success \ + 'trying to create a tag with a non-existing -F file should fail' ' + ! test -f nonexistingfile && + ! tag_exists notag && + ! git-tag -F nonexistingfile notag && + ! tag_exists notag +' + +test_expect_success \ + 'trying to create tags giving many -m or -F options should fail' ' + echo "message file 1" >msgfile1 && + echo "message file 2" >msgfile2 && + ! tag_exists msgtag && + ! git-tag -m "message 1" -m "message 2" msgtag && + ! tag_exists msgtag && + ! git-tag -F msgfile1 -F msgfile2 msgtag && + ! tag_exists msgtag && + ! git-tag -m "message 1" -F msgfile1 msgtag && + ! tag_exists msgtag && + ! git-tag -F msgfile1 -m "message 1" msgtag && + ! tag_exists msgtag && + ! git-tag -F msgfile1 -m "message 1" -F msgfile2 msgtag && + ! tag_exists msgtag && + ! git-tag -m "message 1" -F msgfile1 -m "message 2" msgtag && + ! tag_exists msgtag +' + # blank and empty messages: get_tag_header empty-annotated-tag $commit commit $time >expect @@ -648,6 +673,14 @@ test_expect_success 'creating a signed tag with -F - should succeed' ' git diff expect actual ' +test_expect_success \ + 'trying to create a signed tag with non-existing -F file should fail' ' + ! test -f nonexistingfile && + ! tag_exists nosigtag && + ! git-tag -s -F nonexistingfile nosigtag && + ! tag_exists nosigtag +' + test_expect_success 'verifying a signed tag should succeed' \ 'git-tag -v signed-tag' @@ -957,6 +990,13 @@ test_expect_success \ git diff expect actual ' +# try to sign with bad user.signingkey +git config user.signingkey BobTheMouse +test_expect_failure \ + 'git-tag -s fails if gpg is misconfigured' \ + 'git tag -s -m tail tag-gpg-failure' +git config --unset user.signingkey + # try to verify without gpg: rm -rf gpghome