Dont load diff in compare over 100 commits
This commit is contained in:
parent
72db22d385
commit
6347e9a60b
2 changed files with 14 additions and 1 deletions
|
@ -89,7 +89,14 @@ class Commit
|
|||
if first && last
|
||||
result[:same] = (first.id == last.id)
|
||||
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)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue