diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-20 18:25:36 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-08-03 07:00:19 +0200 |
commit | cd7c2cb6ddd4d9c9f9bdae00c887c0022c121c17 (patch) | |
tree | fad9386721cc514f28a011ef734b8791fc1c13be /app/helpers/diff_helper.rb | |
parent | 195b20e1b9ff08437c5a436dc14f04e7f1bee807 (diff) | |
download | gitlab-ce-cd7c2cb6ddd4d9c9f9bdae00c887c0022c121c17.tar.gz |
Cache highlighted diff lines for merge requests
Introducing the concept of SafeDiffs which relates
diffs with UI highlighting.
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r-- | app/helpers/diff_helper.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index f35e2f6ddcd..6497282af57 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -23,18 +23,17 @@ module DiffHelper end def diff_options - options = { ignore_whitespace_change: hide_whitespace?, no_collapse: expand_all_diffs? } + options = SafeDiffs.default_options.merge( + ignore_whitespace_change: hide_whitespace?, + no_collapse: expand_all_diffs? + ) if action_name == 'diff_for_path' options[:no_collapse] = true options[:paths] = params.values_at(:old_path, :new_path) end - Commit.max_diff_options.merge(options) - end - - def safe_diff_files(diffs, diff_refs: nil, repository: nil) - diffs.decorate! { |diff| Gitlab::Diff::File.new(diff, diff_refs: diff_refs, repository: repository) } + options end def unfold_bottom_class(bottom) |