Class: TagsFinder

Inherits:
GitRefsFinder show all
Defined in:
app/finders/tags_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
15
16
17
18
# File 'app/finders/tags_finder.rb', line 4

def execute(gitaly_pagination: false)
  tags = if gitaly_pagination && search.blank?
           repository.tags_sorted_by(sort, pagination_params)
         else
           repository.tags_sorted_by(sort)
         end

  by_search(tags).tap do |records|
    set_next_cursor(records) if gitaly_pagination
  end
rescue ArgumentError => e
  raise Gitlab::Git::InvalidPageToken, "Invalid page token: #{page_token}" if e.message.include?('page token')

  raise
end

#totalObject



20
21
22
# File 'app/finders/tags_finder.rb', line 20

def total
  repository.tag_count
end