diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-29 15:06:43 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-29 15:06:43 +0000 |
commit | eac0da9a47f0c7b8b970833d7d5b96cfee057bf7 (patch) | |
tree | 7b7865053435c6dcb4e2d945fcf45e309331c91b /lib/gitlab/diff | |
parent | b860c6ba2607541e3b5bdf0fc2daaa9ed41a8726 (diff) | |
download | gitlab-ce-eac0da9a47f0c7b8b970833d7d5b96cfee057bf7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/file_collection/merge_request_diff.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/gitlab/diff/file_collection/merge_request_diff.rb b/lib/gitlab/diff/file_collection/merge_request_diff.rb index c4288ca6408..3d661111f13 100644 --- a/lib/gitlab/diff/file_collection/merge_request_diff.rb +++ b/lib/gitlab/diff/file_collection/merge_request_diff.rb @@ -4,12 +4,16 @@ module Gitlab module Diff module FileCollection class MergeRequestDiff < MergeRequestDiffBase + include Gitlab::Utils::StrongMemoize + def diff_files - diff_files = super + strong_memoize(:diff_files) do + diff_files = super - diff_files.each { |diff_file| cache.decorate(diff_file) } + diff_files.each { |diff_file| cache.decorate(diff_file) } - diff_files + diff_files + end end override :write_cache |