diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2017-02-03 15:03:57 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2017-02-03 15:03:57 +0000 |
commit | 806b038a44cda37fa7d8ba9afae4b7adb07afe94 (patch) | |
tree | f8841e93eb070feae34fa2cc5f61e0efecf88bd0 /app/controllers/projects_controller.rb | |
parent | 52ea505126da19717c9137e6bb301f55965eb6e4 (diff) | |
parent | 50d58c14cd2cd1b8fb1bb9e4a7a1091b5af90c04 (diff) | |
download | gitlab-ce-806b038a44cda37fa7d8ba9afae4b7adb07afe94.tar.gz |
Merge branch 'ref-switcher-perf' into 'master'
Improved ref switcher dropdown performance
Closes #18202
See merge request !7239
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 444ff837bb3..acca821782c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -231,12 +231,16 @@ class ProjectsController < Projects::ApplicationController end def refs + branches = BranchesFinder.new(@repository, params).execute.map(&:name) + options = { - 'Branches' => @repository.branch_names, + 'Branches' => branches.take(100), } unless @repository.tag_count.zero? - options['Tags'] = VersionSorter.rsort(@repository.tag_names) + tags = TagsFinder.new(@repository, params).execute.map(&:name) + + options['Tags'] = tags.take(100) end # If reference is commit id - we should add it to branch/tag selectbox |