]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7004-tag.sh
tag: advise on nested tags
[thirdparty/git.git] / t / t7004-tag.sh
index 0b01862c23aa182ee4ae7ce2944a40b4449d6049..e285686662df781c87d59c910aa9d596eb974c34 100755 (executable)
@@ -1700,6 +1700,17 @@ test_expect_success '--points-at finds annotated tags of tags' '
        test_cmp expect actual
 '
 
+test_expect_success 'recursive tagging should give advice' '
+       sed -e "s/|$//" <<-EOF >expect &&
+       hint: You have created a nested tag. The object referred to by your new is
+       hint: already a tag. If you meant to tag the object that it points to, use:
+       hint: |
+       hint:   git tag -f nested annotated-v4.0^{}
+       EOF
+       git tag -m nested nested annotated-v4.0 2>actual &&
+       test_i18ncmp expect actual
+'
+
 test_expect_success 'multiple --points-at are OR-ed together' '
        cat >expect <<-\EOF &&
        v2.0