summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-25 12:16:14 +0300
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-25 12:16:14 +0300
commit6d0dcb6614fc0743d50ffe68bf61c2c50728c1d6 (patch)
tree131346c6348cf7d509e11fe1de21626a1912fa89 /app/models/commit.rb
parent1ea0dd0ffc37232d27f4fa1350af6ebb3b5439f2 (diff)
downloadgitlab-ce-6d0dcb6614fc0743d50ffe68bf61c2c50728c1d6.tar.gz
Reduce max commit diff size. Added Commit::DIFF_SAFE_SIZE
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index a070e830680..e6a87dd9217 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -4,6 +4,11 @@ class Commit
include StaticModel
extend ActiveModel::Naming
+ # Safe amount of files with diffs in one commit to render
+ # Used to prevent 500 error on huge commits by suppressing diff
+ #
+ DIFF_SAFE_SIZE = 100
+
attr_accessor :commit, :head, :refs
delegate :message, :authored_date, :committed_date, :parents, :sha,