diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-03-20 23:11:45 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-20 23:11:45 +0300 |
commit | f57610a1ff7a547d1e11e24f942b1703cea81f81 (patch) | |
tree | b1157b51c682216794a750556aae362830ade856 /t/t7004-tag.sh | |
parent | 9ab698f4000a736864c41f57fbae1e021ac27799 (diff) | |
parent | 5751a3d1954cd2e362ba1ca9625acdc8c5185a25 (diff) |
Merge branch 'nd/versioncmp-prereleases'
The versionsort.prerelease configuration variable can be used to
specify that v1.0-pre1 comes before v1.0.
* nd/versioncmp-prereleases:
config.txt: update versioncmp.prereleaseSuffix
versionsort: support reorder prerelease suffixes
Diffstat (limited to 't/t7004-tag.sh')
-rwxr-xr-x | t/t7004-tag.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 35c805a44e..8bfeef9b0b 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 && "$@") } |