summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2016-08-08 14:36:39 -0400
committerAlejandro Rodríguez <alejorro70@gmail.com>2016-08-08 14:36:39 -0400
commit6af4efea872407bf7f3957f3009984989a3a8e8f (patch)
treeaad973ce24a02cb62082973abb3c1da09dfd6b1f
parenta77394a7e526b462057c0ef88e5b8b06b96e2290 (diff)
downloadgitlab-ce-6af4efea872407bf7f3957f3009984989a3a8e8f.tar.gz
Update version_sorter and use new interface for faster tag sorting
-rw-r--r--CHANGELOG1
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/models/repository.rb4
4 files changed, 5 insertions, 6 deletions
diff --git a/CHANGELOG b/CHANGELOG
index f5416434ab1..a00b98cfe07 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -33,6 +33,7 @@ v 8.11.0 (unreleased)
- Retrieve rendered HTML from cache in one request
- Fix renaming repository when name contains invalid chararacters under project settings
- Fix devise deprecation warnings.
+ - Update version_sorter and use new interface for faster tag sorting
- Optimize checking if a user has read access to a list of issues !5370
- Nokogiri's various parsing methods are now instrumented
- Add simple identifier to public SSH keys (muteor)
diff --git a/Gemfile b/Gemfile
index 8f94ee72a32..104929665e8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -154,7 +154,7 @@ gem 'settingslogic', '~> 2.0.9'
# Misc
-gem 'version_sorter', '~> 2.0.0'
+gem 'version_sorter', '~> 2.1.0'
# Cache
gem 'redis-rails', '~> 4.0.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 870f9397b9e..87f08d6f372 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -778,7 +778,7 @@ GEM
uniform_notifier (1.10.0)
uuid (2.3.8)
macaddr (~> 1.0)
- version_sorter (2.0.0)
+ version_sorter (2.1.0)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
@@ -989,7 +989,7 @@ DEPENDENCIES
unf (~> 0.1.4)
unicorn (~> 4.9.0)
unicorn-worker-killer (~> 0.4.2)
- version_sorter (~> 2.0.0)
+ version_sorter (~> 2.1.0)
virtus (~> 1.0.1)
vmstat (~> 2.1.1)
web-console (~> 2.0)
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 701f867f67c..e56bac509a4 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -636,9 +636,7 @@ class Repository
def tags_sorted_by(value)
case value
when 'name'
- # Would be better to use `sort_by` but `version_sorter` only exposes
- # `sort` and `rsort`
- VersionSorter.rsort(tag_names).map { |tag_name| find_tag(tag_name) }
+ VersionSorter.rsort(tags) { |tag| tag.name }
when 'updated_desc'
tags_sorted_by_committed_date.reverse
when 'updated_asc'