summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-09-25 02:39:34 -0700
committerStan Hu <stanhu@gmail.com>2015-09-25 02:40:34 -0700
commita44ca15c1dd71381d6b11638003f60253c2d8964 (patch)
tree49962a36c1e476a2fb989fcf7fec33625ab38325
parent718817fd8fcc0b3627fca73ca847d5fb676df980 (diff)
downloadgitlab-ce-a44ca15c1dd71381d6b11638003f60253c2d8964.tar.gz
Fix Error 500 in creating merge requests with > 1000 diffs
Closes #2692
-rw-r--r--CHANGELOG1
-rw-r--r--app/models/merge_request_diff.rb4
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 99e327472f4..68305b3b380 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 8.1.0 (unreleased)
+ - Fix Error 500 in creating merge requests with > 1000 diffs (Stan Hu)
- Show CI status on all pages where commits list is rendered
- Automatically enable CI when push .gitlab-ci.yml file to repository
- Move CI charts to project graphs area
diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb
index e317c8eac4d..f75f999b0d0 100644
--- a/app/models/merge_request_diff.rb
+++ b/app/models/merge_request_diff.rb
@@ -123,12 +123,12 @@ class MergeRequestDiff < ActiveRecord::Base
if new_diffs.any?
if new_diffs.size > Commit::DIFF_HARD_LIMIT_FILES
self.state = :overflow_diff_files_limit
- new_diffs = new_diffs.first[Commit::DIFF_HARD_LIMIT_LINES]
+ new_diffs = new_diffs.first(Commit::DIFF_HARD_LIMIT_LINES)
end
if new_diffs.sum { |diff| diff.diff.lines.count } > Commit::DIFF_HARD_LIMIT_LINES
self.state = :overflow_diff_lines_limit
- new_diffs = new_diffs.first[Commit::DIFF_HARD_LIMIT_LINES]
+ new_diffs = new_diffs.first(Commit::DIFF_HARD_LIMIT_LINES)
end
end