Class: BranchesFinder

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

Instance Attribute Summary

Attributes inherited from GitRefsFinder

#next_cursor

Instance Method Summary collapse

Methods inherited from GitRefsFinder

#initialize

Constructor Details

This class inherits a constructor from GitRefsFinder

Instance Method Details

#execute(gitaly_pagination: false) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'app/finders/branches_finder.rb', line 4

def execute(gitaly_pagination: false)
  if gitaly_pagination && search.blank? && regex.blank?
    repository.branches_sorted_by(sort, pagination_params).tap do |branches|
      set_next_cursor(branches)
    end
  else
    branches = repository.branches_sorted_by(sort)
    branches = by_search(branches)
    by_regex(branches)
  end
end

#totalObject



16
17
18
# File 'app/finders/branches_finder.rb', line 16

def total
  repository.branch_count
end