diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-15 09:04:18 +0200 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-18 14:43:28 -0600 |
commit | a404ab380db5959ab22b09bc586607b1f6c507cd (patch) | |
tree | 68cadd8516a1db0997dfa09e8fafd12b35391d78 /lib | |
parent | 65352b5baaf269a609b024fd13efc81e8bbdcefa (diff) | |
download | gitlab-ce-a404ab380db5959ab22b09bc586607b1f6c507cd.tar.gz |
Collapsed diffs lines/size don't accumulate to overflow diffs.19820-safer-diffs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/file.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index 7e01f7b61fb..b09ca1fb8b0 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -5,7 +5,7 @@ module Gitlab delegate :new_file, :deleted_file, :renamed_file, :old_path, :new_path, :a_mode, :b_mode, - :submodule?, :too_large?, to: :diff, prefix: false + :submodule?, :too_large?, :collapsed?, to: :diff, prefix: false def initialize(diff, repository:, diff_refs: nil) @diff = diff @@ -68,10 +68,6 @@ module Gitlab @lines ||= Gitlab::Diff::Parser.new.parse(raw_diff.each_line).to_a end - def collapsed_by_default? - diff.diff.bytesize > 10240 # 10 KB - end - def highlighted_diff_lines @highlighted_diff_lines ||= Gitlab::Diff::Highlight.new(self, repository: self.repository).highlight end |