summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-06-17 08:55:05 +0100
committerSean McGivern <sean@gitlab.com>2016-06-17 08:55:05 +0100
commit1022a1678b2b08fd226a5c88e4c472b8426de1c4 (patch)
tree7031381b212ec388236da82d6746e06a15007b3c
parentf011b86beb89557afdaf2b0ec5ae904d0be237d8 (diff)
downloadgitlab-ce-limit-email-diff-size.tar.gz
Limit push email diff sizelimit-email-diff-size
Limit push email diff size to 30 files or 150 KB, whichever comes first.
-rw-r--r--CHANGELOG1
-rw-r--r--lib/gitlab/email/message/repository_push.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0596ff37856..d43680c4ab2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -48,6 +48,7 @@ v 8.9.0 (unreleased)
- Add `sha` parameter to MR merge API, to ensure only reviewed changes are merged
- Don't allow MRs to be merged when commits were added since the last review / page load
- Add DB index on users.state
+ - Limit email on push diff size to 30 files / 150 KB
- Add rake task 'gitlab:db:configure' for conditionally seeding or migrating the database
- Changed the Slack build message to use the singular duration if necessary (Aran Koning)
- Fix race condition on merge when build succeeds
diff --git a/lib/gitlab/email/message/repository_push.rb b/lib/gitlab/email/message/repository_push.rb
index e2fee6b9f3e..047c77c6fc2 100644
--- a/lib/gitlab/email/message/repository_push.rb
+++ b/lib/gitlab/email/message/repository_push.rb
@@ -37,7 +37,7 @@ module Gitlab
end
def diffs
- @diffs ||= (safe_diff_files(compare.diffs, diff_refs) if compare)
+ @diffs ||= (safe_diff_files(compare.diffs(max_files: 30), diff_refs) if compare)
end
def diffs_count