Merge branch 'km/imap-send-libcurl-options'
[gitweb.git] / t / t7004-tag.sh
index 35c805a44e817c637c667b1d1d14d97b4ee46803..8bfeef9b0bf6eedcd1f0b31a141efc87a37041f8 100755 (executable)
@@ -1459,6 +1459,34 @@ test_expect_success 'invalid sort parameter in configuratoin' '
        test_cmp expect actual
 '
 
+test_expect_success 'version sort with prerelease reordering' '
+       git config --unset tag.sort &&
+       git config versionsort.prereleaseSuffix -rc &&
+       git tag foo1.6-rc1 &&
+       git tag foo1.6-rc2 &&
+       git tag -l --sort=version:refname "foo*" >actual &&
+       cat >expect <<-\EOF &&
+       foo1.3
+       foo1.6-rc1
+       foo1.6-rc2
+       foo1.6
+       foo1.10
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'reverse version sort with prerelease reordering' '
+       git tag -l --sort=-version:refname "foo*" >actual &&
+       cat >expect <<-\EOF &&
+       foo1.10
+       foo1.6
+       foo1.6-rc2
+       foo1.6-rc1
+       foo1.3
+       EOF
+       test_cmp expect actual
+'
+
 run_with_limited_stack () {
        (ulimit -s 128 && "$@")
 }