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 13:02:44 +0100
commit61795caaf7b66fe7d068ce13fd73c18f063f724b (patch)
treed08cf837de44878de0117da214851eb0b435ea5d /lib
parent33a25e0fc61a1436bfbe9b1e3079c5790a726492 (diff)
downloadgitlab-ce-mr-diff-size-overflow.tar.gz
Show correct size when MR diff overflowsmr-diff-size-overflow
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.