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? && regex.blank?
    repository.branches_sorted_by(sort, pagination_params)
  else
    branches = repository.branches_sorted_by(sort)
    branches = by_search(branches)
    branches = by_regex(branches)
    by_names(branches)
  end
end

#totalObject



19
20
21
# File 'app/finders/branches_finder.rb', line 19

def total
  repository.branch_count
end