]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t6300-for-each-ref.sh
path.c: don't call the match function without value in trie_find()
[thirdparty/git.git] / t / t6300-for-each-ref.sh
index d9235217fcc72912574c80cea684aa17c8b736d2..ab69aa176d14bf2d8dd88be1d7cbae0560609be8 100755 (executable)
@@ -345,6 +345,32 @@ test_expect_success 'Verify descending sort' '
        test_cmp expected actual
 '
 
+cat >expected <<\EOF
+refs/tags/testtag
+refs/tags/testtag-2
+EOF
+
+test_expect_success 'exercise patterns with prefixes' '
+       git tag testtag-2 &&
+       test_when_finished "git tag -d testtag-2" &&
+       git for-each-ref --format="%(refname)" \
+               refs/tags/testtag refs/tags/testtag-2 >actual &&
+       test_cmp expected actual
+'
+
+cat >expected <<\EOF
+refs/tags/testtag
+refs/tags/testtag-2
+EOF
+
+test_expect_success 'exercise glob patterns with prefixes' '
+       git tag testtag-2 &&
+       test_when_finished "git tag -d testtag-2" &&
+       git for-each-ref --format="%(refname)" \
+               refs/tags/testtag "refs/tags/testtag-*" >actual &&
+       test_cmp expected actual
+'
+
 cat >expected <<\EOF
 'refs/heads/master'
 'refs/remotes/origin/master'