Unverified Commit 8f88cbf0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Use MergeRequestDiff::COMMITS_SAFE_SIZE for Compare diff limit.


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent ce9f8ffc5cfc
......@@ -8,7 +8,7 @@ def index
end
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
@commit = compare.commit
......
......@@ -14,7 +14,7 @@
&nbsp;
= submit_tag "Compare", class: "btn btn-create commits-compare-btn"
- 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
......
......@@ -5,12 +5,6 @@
= 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?
%div.ui-box
.title
......@@ -24,9 +18,15 @@
- else
%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
- 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
.light-well
%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