t7501-commit: drop silly command substitution
[gitweb.git] / t / t7004-tag.sh
index 5446060ffb75302f6c4c876299a0c7cfa6cedaf4..d1ff5c94f2f3241b3b1ed436d0011280986abab7 100755 (executable)
@@ -1180,8 +1180,8 @@ test_expect_success 'message in editor has initial comment: first line' '
 test_expect_success \
        'message in editor has initial comment: remainder' '
        # remove commented lines from the remainder -- should be empty
-       >rest.expect
-       sed -e 1d -e '/^#/d' <actual >rest.actual &&
+       >rest.expect &&
+       sed -e 1d -e "/^#/d" <actual >rest.actual &&
        test_cmp rest.expect rest.actual
 '
 
@@ -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 && "$@")
 }