diff options
Diffstat (limited to 'app/finders/git_refs_finder.rb')
-rw-r--r-- | app/finders/git_refs_finder.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/finders/git_refs_finder.rb b/app/finders/git_refs_finder.rb index 3c8d53051d6..521b4aa171f 100644 --- a/app/finders/git_refs_finder.rb +++ b/app/finders/git_refs_finder.rb @@ -3,9 +3,12 @@ class GitRefsFinder include Gitlab::Utils::StrongMemoize + attr_reader :next_cursor + def initialize(repository, params = {}) @repository = repository @params = params + @next_cursor = nil end protected @@ -54,4 +57,13 @@ class GitRefsFinder def unescape_regex_operators(regex_string) regex_string.sub('\^', '^').gsub('\*', '.*?').sub('\$', '$') end + + def set_next_cursor(records) + return if records.blank? + + # TODO: Gitaly should be responsible for a cursor generation + # Follow-up for branches: https://gitlab.com/gitlab-org/gitlab/-/issues/431903 + # Follow-up for tags: https://gitlab.com/gitlab-org/gitlab/-/issues/431904 + @next_cursor = records.last.name + end end |