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 <<EOF
v0.2.1
v1.0.1
-v1.1.3
EOF
test_expect_success \
- 'listing tags with substring as pattern must print those matching' '
- git-tag -l .1 > actual &&
+ 'listing tags with a suffix as pattern must print those matching' '
+ git-tag -l "*.1" > actual &&
git diff expect actual
'
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 <<EOF
a1
-aa1
EOF
test_expect_success \
- 'listing tags using a name as pattern must print those matching' '
+ 'listing tags using a name as pattern must print that one matching' '
git-tag -l a1 > actual &&
git diff expect actual
'
cat >expect <<EOF
v1.0
-v1.0.1
EOF
test_expect_success \
- 'listing tags using a name as pattern must print those matching' '
+ 'listing tags using a name as pattern must print that one matching' '
git-tag -l v1.0 > actual &&
git diff expect actual
'
cat >expect <<EOF
+v1.0.1
v1.1.3
EOF
test_expect_success \
'listing tags with ? in the pattern should print those matching' '
- git-tag -l "1.1?" > actual &&
+ git-tag -l "v1.?.?" > actual &&
git diff expect actual
'
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
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'
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