diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /lib/gitlab/diff/file_collection/base.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'lib/gitlab/diff/file_collection/base.rb')
-rw-r--r-- | lib/gitlab/diff/file_collection/base.rb | 15 |
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? |