Class: BranchesFinder

Inherits:
GitRefsFinder show all
Defined in:
app/finders/branches_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(repository, params = {}) ⇒ BranchesFinder

Returns a new instance of BranchesFinder.


4
5
6
# File 'app/finders/branches_finder.rb', line 4

def initialize(repository, params = {})
  super(repository, params)
end

Instance Method Details

#execute(gitaly_pagination: false) ⇒ Object


8
9
10
11
12
13
14
15
16
17
# File 'app/finders/branches_finder.rb', line 8

def execute(gitaly_pagination: false)
  if gitaly_pagination && names.blank? && search.blank?
    repository.branches_sorted_by(sort, pagination_params)
  else
    branches = repository.branches_sorted_by(sort)
    branches = by_search(branches)
    branches = by_names(branches)
    branches
  end
end