Commit 8f88cbf0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Use MergeRequestDiff::COMMITS_SAFE_SIZE for Compare diff limit.

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 68249f23
...@@ -8,7 +8,7 @@ class Projects::CompareController < Projects::ApplicationController ...@@ -8,7 +8,7 @@ class Projects::CompareController < Projects::ApplicationController
end end
def show def show
compare = Gitlab::Git::Compare.new(@repository.raw_repository, params[:from], params[:to]) compare = Gitlab::Git::Compare.new(@repository.raw_repository, params[:from], params[:to], MergeRequestDiff::COMMITS_SAFE_SIZE)
@commits = compare.commits @commits = compare.commits
@commit = compare.commit @commit = compare.commit
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
&nbsp; &nbsp;
= submit_tag "Compare", class: "btn btn-create commits-compare-btn" = submit_tag "Compare", class: "btn btn-create commits-compare-btn"
- if compare_to_mr_button? - if compare_to_mr_button?
= link_to compare_mr_path, class: 'prepend-left-10' do = link_to compare_mr_path, class: 'prepend-left-10 btn' do
%strong Make a merge request %strong Make a merge request
......
...@@ -5,12 +5,6 @@ ...@@ -5,12 +5,6 @@
= render "form" = render "form"
- if @commits.size > 100
.alert.alert-warning
%p
%strong Warning! This comparison includes more than 100 commits.
%p To preserve performance the line diff is not shown.
- if @commits.present? - if @commits.present?
%div.ui-box %div.ui-box
.title .title
...@@ -24,9 +18,15 @@ ...@@ -24,9 +18,15 @@
- else - else
%ul.well-list= render Commit.decorate(@commits), project: @project %ul.well-list= render Commit.decorate(@commits), project: @project
- unless @diffs.empty?
%h4 Diff %h4 Diff
- if @diffs.present?
= render "projects/commits/diffs", diffs: @diffs, project: @project = 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.
%p To preserve performance the line diff is not shown.
- else - else
.light-well .light-well
%center %center
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment