summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 17d41f27f34..daba5414afa 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -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