Commit 59e1819561912cb38bf00a7a34de1ac9e85c3a35
1 parent
04e8b518
Exists in
spb-stable
and in
2 other branches
Apply soft diff limits to MergeRequest#new page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
6 additions
and
2 deletions
Show diff stats
app/controllers/projects/merge_requests_controller.rb
... | ... | @@ -90,6 +90,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController |
90 | 90 | @merge_request.title = @merge_request.source_branch.titleize.humanize |
91 | 91 | @target_project = @merge_request.target_project |
92 | 92 | @target_repo = @target_project.repository |
93 | + | |
94 | + diff_line_count = Commit::diff_line_count(@diffs) | |
95 | + @suppress_diff = Commit::diff_suppress?(@diffs, diff_line_count) | |
93 | 96 | end |
94 | 97 | end |
95 | 98 | ... | ... |
app/views/projects/commits/_diffs.html.haml
... | ... | @@ -6,12 +6,13 @@ |
6 | 6 | %p |
7 | 7 | To preserve performance the diff is not shown. |
8 | 8 | - if current_controller?(:commit) or current_controller?(:merge_requests) |
9 | - Please, download the diff as | |
10 | 9 | - if current_controller?(:commit) |
10 | + Please, download the diff as | |
11 | 11 | = link_to "plain diff", project_commit_path(@project, @commit, format: :diff), class: "underlined-link" |
12 | 12 | or |
13 | 13 | = link_to "email patch", project_commit_path(@project, @commit, format: :patch), class: "underlined-link" |
14 | - - else | |
14 | + - elsif @merge_request && @merge_request.persisted? | |
15 | + Please, download the diff as | |
15 | 16 | = link_to "plain diff", project_merge_request_path(@project, @merge_request, format: :diff), class: "underlined-link" |
16 | 17 | or |
17 | 18 | = link_to "email patch", project_merge_request_path(@project, @merge_request, format: :patch), class: "underlined-link" | ... | ... |