diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb index 02fcb8d..696cb7a 100644 --- a/app/controllers/projects/compare_controller.rb +++ b/app/controllers/projects/compare_controller.rb @@ -16,6 +16,11 @@ class Projects::CompareController < Projects::ApplicationController @refs_are_same = compare.same @line_notes = [] + if @diffs == [Gitlab::Git::Diff::BROKEN_DIFF] + @diffs = [] + @timeout = true + end + diff_line_count = Commit::diff_line_count(@diffs) @suppress_diff = Commit::diff_suppress?(@diffs, diff_line_count) && !params[:force_show_diff] @force_suppress_diff = Commit::diff_force_suppress?(@diffs, diff_line_count) diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml index e0c1b01..9bd4985 100644 --- a/app/views/projects/compare/show.html.haml +++ b/app/views/projects/compare/show.html.haml @@ -22,10 +22,14 @@ - if @diffs.present? = render "projects/commits/diffs", diffs: @diffs, project: @project - elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE - .alert.alert-warning - %p - %strong Warning! This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits. + .bs-callout.bs-callout-danger + %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits. %p To preserve performance the line diff is not shown. + - elsif @timeout + .bs-callout.bs-callout-danger + %h4 Diff for this comparison is extremely large. + %p Use command line to browse diff for this comparison. + - else .light-well -- libgit2 0.21.2