diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-15 10:04:18 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-18 23:43:28 +0300 |
commit | a404ab380db5959ab22b09bc586607b1f6c507cd (patch) | |
tree | 68cadd8516a1db0997dfa09e8fafd12b35391d78 /app/helpers/diff_helper.rb | |
parent | 65352b5baaf269a609b024fd13efc81e8bbdcefa (diff) |
Collapsed diffs lines/size don't accumulate to overflow diffs.
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r-- | app/helpers/diff_helper.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index adab901700c..75b029365f9 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -9,7 +9,7 @@ module DiffHelper end def expand_all_diffs? - @expand_all_diffs || params[:expand_all_diffs].present? + params[:expand_all_diffs].present? end def diff_view @@ -23,13 +23,14 @@ module DiffHelper end def diff_options - default_options = Commit.max_diff_options + options = { ignore_whitespace_change: hide_whitespace?, no_collapse: expand_all_diffs? } if action_name == 'diff_for_path' - default_options[:paths] = params.values_at(:old_path, :new_path) + options[:no_collapse] = true + options[:paths] = params.values_at(:old_path, :new_path) end - default_options.merge(ignore_whitespace_change: hide_whitespace?) + Commit.max_diff_options.merge(options) end def safe_diff_files(diffs, diff_refs: nil, repository: nil) |