Commit 6347e9a6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Dont load diff in compare over 100 commits

parent 72db22d3
...@@ -89,7 +89,14 @@ class Commit ...@@ -89,7 +89,14 @@ class Commit
if first && last if first && last
result[:same] = (first.id == last.id) result[:same] = (first.id == last.id)
result[:commits] = project.repo.commits_between(last.id, first.id).map {|c| Commit.new(c)} result[:commits] = project.repo.commits_between(last.id, first.id).map {|c| Commit.new(c)}
result[:diffs] = project.repo.diff(last.id, first.id) rescue []
# Dont load diff for 100+ commits
result[:diffs] = if result[:commits].size > 100
[]
else
project.repo.diff(last.id, first.id) rescue []
end
result[:commit] = Commit.new(first) result[:commit] = Commit.new(first)
end end
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
= render "form" = render "form"
- if @commits.size > 100
.alert.alert-block
%p
%strong Warning! This comparison include 100+ commits.
%p To prevent performance issue we dont show diff information.
- if @commits.present? - if @commits.present?
%div.ui-box %div.ui-box
%h5.title %h5.title
......
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