summaryrefslogtreecommitdiff
path: root/lib/gitlab/diff/file_collection/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/diff/file_collection/base.rb')
-rw-r--r--lib/gitlab/diff/file_collection/base.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/gitlab/diff/file_collection/base.rb b/lib/gitlab/diff/file_collection/base.rb
index 9ed03c05f0b..f3f0f227a8c 100644
--- a/lib/gitlab/diff/file_collection/base.rb
+++ b/lib/gitlab/diff/file_collection/base.rb
@@ -19,6 +19,7 @@ module Gitlab
@diffable = diffable
@include_stats = diff_options.delete(:include_stats)
+ @pagination_data = diff_options.delete(:pagination_data)
@project = project
@diff_options = diff_options
@diff_refs = diff_refs
@@ -47,11 +48,7 @@ module Gitlab
end
def pagination_data
- {
- current_page: nil,
- next_page: nil,
- total_pages: nil
- }
+ @pagination_data || empty_pagination_data
end
# This mutates `diff_files` lines.
@@ -90,6 +87,14 @@ module Gitlab
private
+ def empty_pagination_data
+ {
+ current_page: nil,
+ next_page: nil,
+ total_pages: nil
+ }
+ end
+
def diff_stats_collection
strong_memoize(:diff_stats) do
next unless fetch_diff_stats?