Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hord <hordp@cisco.com>2013-03-13 03:13:41 +0400
committerJunio C Hamano <gitster@pobox.com>2013-03-13 21:35:15 +0400
commit3ae851e6fbb4e99fa7281d18a5c6f95a3fb6d998 (patch)
tree8d9a4a19d6916b1b6c9f9e5484f1d7851ecc8c7f /t/t7004-tag.sh
parent03a0fb0ccf48c831060c2243f830b6a12cd8fdf3 (diff)
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>
Diffstat (limited to 't/t7004-tag.sh')
-rwxr-xr-xt/t7004-tag.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index f5a79b13ae..c8d6e9f88c 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -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' '