Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-02-26 13:44:01 +0300
committerJunio C Hamano <gitster@pobox.com>2015-02-28 00:38:22 +0300
commitd811c8e17c652e62a97e75abf80dfea5d81ef309 (patch)
tree047e6678d308dd8032e6a09501764974bc31f93e /t
parentfdf96a20acf96a6ac538df8113b2aafd6ed71d50 (diff)
versionsort: support reorder prerelease suffixes
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7004-tag.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 796e9f79ea..5674fe9f72 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -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 && "$@")
}