t7406-submodule-update: add missing &&
[gitweb.git] / t / t6120-describe.sh
index a25729f2a7bb4c4d4f755ef5f855261ee1d71645..c0e5b2a6275df2d92172327b2d629cc73720423e 100755 (executable)
@@ -174,4 +174,28 @@ check_describe "test2-lightweight-*" --tags --match="test2-*"
 
 check_describe "test2-lightweight-*" --long --tags --match="test2-*" HEAD^
 
+test_expect_success 'name-rev with exact tags' '
+       echo A >expect &&
+       tag_object=$(git rev-parse refs/tags/A) &&
+       git name-rev --tags --name-only $tag_object >actual &&
+       test_cmp expect actual &&
+
+       echo "A^0" >expect &&
+       tagged_commit=$(git rev-parse "refs/tags/A^0") &&
+       git name-rev --tags --name-only $tagged_commit >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'describe --contains with the exact tags' '
+       echo "A^0" >expect &&
+       tag_object=$(git rev-parse refs/tags/A) &&
+       git describe --contains $tag_object >actual &&
+       test_cmp expect actual &&
+
+       echo "A^0" >expect &&
+       tagged_commit=$(git rev-parse "refs/tags/A^0") &&
+       git describe --contains $tagged_commit >actual &&
+       test_cmp expect actual
+'
+
 test_done