diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-01-07 22:37:01 -0500 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-01-07 22:37:01 -0500 |
commit | 21b602c60ad787b63039d804a5e15b43d0d3c32c (patch) | |
tree | 91a068f9360b295c14599dd6547972c416a3614d /app/helpers/diff_helper.rb | |
parent | f1f4fdf778245cab74ff9cda2a421315c21a99aa (diff) | |
download | gitlab-ce-21b602c60ad787b63039d804a5e15b43d0d3c32c.tar.gz |
Change strategy to highlight diffs. #3945
Now we apply syntax highlighting to the whole old and new files.
This basically help us to highlight adequately multiline content.
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r-- | app/helpers/diff_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 22deb69cec5..668610364c5 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -19,13 +19,13 @@ module DiffHelper end end - def safe_diff_files(diffs) + def safe_diff_files(diffs, diff_refs, repository) lines = 0 safe_files = [] diffs.first(allowed_diff_size).each do |diff| lines += diff.diff.lines.count break if lines > allowed_diff_lines - safe_files << Gitlab::Diff::File.new(diff) + safe_files << Gitlab::Diff::File.new(diff, diff_refs, repository) end safe_files end |