test: test_must_be_empty helper
[gitweb.git] / t / t7004-tag.sh
index f5a79b13aecf4020b8a453f5f27568ce4f88bbbc..c8d6e9f88cc36f7e6a1208721ea6c45991452b9e 100755 (executable)
@@ -104,6 +104,18 @@ test_expect_success 'creating a tag using HEAD directly should succeed' '
        tag_exists myhead
 '
 
+test_expect_success '--force can create a tag with the name of one existing' '
+       tag_exists mytag &&
+       git tag --force mytag &&
+       tag_exists mytag'
+
+test_expect_success '--force is moot with a non-existing tag name' '
+       git tag newtag >expect &&
+       git tag --force forcetag >actual &&
+       test_cmp expect actual
+'
+git tag -d newtag forcetag
+
 # deleting tags:
 
 test_expect_success 'trying to delete an unknown tag should fail' '