diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/finders/repositories/branch_names_finder.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/finders/repositories/branch_names_finder.rb')
-rw-r--r-- | app/finders/repositories/branch_names_finder.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/finders/repositories/branch_names_finder.rb b/app/finders/repositories/branch_names_finder.rb index 5bb67425aa5..8c8c7405407 100644 --- a/app/finders/repositories/branch_names_finder.rb +++ b/app/finders/repositories/branch_names_finder.rb @@ -10,9 +10,9 @@ module Repositories end def execute - return unless search + return unless search && offset && limit - repository.search_branch_names(search) + repository.search_branch_names(search).lazy.drop(offset).take(limit) # rubocop:disable CodeReuse/ActiveRecord end private @@ -20,5 +20,13 @@ module Repositories def search @params[:search].presence end + + def offset + @params[:offset] + end + + def limit + @params[:limit] + end end end |