summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-04-20 15:47:32 +0100
committerSean McGivern <sean@gitlab.com>2017-04-25 16:54:10 +0100
commita0979c05fd5976cabe3c0633c168848d66320bfa (patch)
treeec0aa3a394e875871cdec10ce61a3e75ba7f3eb9 /lib
parentd1e570221bfdf1f513af017e39d7ebfe8967cfe3 (diff)
downloadgitlab-ce-a0979c05fd5976cabe3c0633c168848d66320bfa.tar.gz
Show correct size when MR diff overflows
The problem is that we often go via a diff object constructed from the diffs stored in the DB. Those diffs, by definition, don't overflow, so we don't have access to the 'correct' `real_size` - that is stored on the MR diff object iself.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/diff/file_collection/merge_request_diff.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/diff/file_collection/merge_request_diff.rb b/lib/gitlab/diff/file_collection/merge_request_diff.rb
index 329d12f13d1..0bd226ef050 100644
--- a/lib/gitlab/diff/file_collection/merge_request_diff.rb
+++ b/lib/gitlab/diff/file_collection/merge_request_diff.rb
@@ -15,6 +15,10 @@ module Gitlab
super.tap { |_| store_highlight_cache }
end
+ def real_size
+ @merge_request_diff.real_size
+ end
+
private
# Extracted method to highlight in the same iteration to the diff_collection.