tag: --force does not have to warn when creating tags
"git tag --force" mentions what old tag object is being replaced when it is used to update an existing tag, but it shows the same message when creating a new one. Stop doing that, as it does not add any information. Add a test for this and also to ensure --force can replace tags at all. Signed-off-by: Phil Hord <hordp@cisco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
03a0fb0ccf
commit
3ae851e6fb
@ -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' '
|
||||
|
Reference in New Issue
Block a user