Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-07-20 19:25:36 +0300
committerPaco Guzman <pacoguzmanp@gmail.com>2016-08-03 08:00:19 +0300
commitcd7c2cb6ddd4d9c9f9bdae00c887c0022c121c17 (patch)
treefad9386721cc514f28a011ef734b8791fc1c13be /app/helpers/diff_helper.rb
parent195b20e1b9ff08437c5a436dc14f04e7f1bee807 (diff)
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.rb11
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)