diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/helpers/diff_helper.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r-- | app/helpers/diff_helper.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 7bf3cb6230b..e430b0f402b 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -23,14 +23,16 @@ module DiffHelper end end + def show_only_context_commits? + !!params[:only_context_commits] || @merge_request&.commits&.empty? + end + def diff_options options = { ignore_whitespace_change: hide_whitespace?, expanded: diffs_expanded? } if action_name == 'diff_for_path' options[:expanded] = true options[:paths] = params.values_at(:old_path, :new_path) - elsif action_name == 'show' - options[:include_context_commits] = true unless @project.context_commits_enabled? end options |