summaryrefslogtreecommitdiff
path: root/t/t7004-tag.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7004-tag.sh')
-rwxr-xr-xt/t7004-tag.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index a0be164..c4fa446 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -332,6 +332,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 +675,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'