Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-10-24 19:01:44 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-11-07 18:27:55 +0300
commit6fbdc5ed5224154b89cf351e11a8f9db48e6d7f0 (patch)
treedd2ccecd4b1100d4b83f91292b96ec988eecde6d /app/workers/email_receiver_worker.rb
parent6d8810a64f944ff96af54e5c759f866bb68a7453 (diff)
Apply patches when creating MR via email
This allows users to add patches as attachments to merge request created via email. When an email to create a merge request is sent, all the attachments ending in `.patch` will be applied to the branch specified in the subject of the email. If the branch did not exist, it will be created from the HEAD of the repository. When the patches could not be applied, the error message will be replied to the user. The patches can have a maximum combined size of 2MB for now.
Diffstat (limited to 'app/workers/email_receiver_worker.rb')
-rw-r--r--app/workers/email_receiver_worker.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/workers/email_receiver_worker.rb b/app/workers/email_receiver_worker.rb
index 12706613ac2..bf637f82df2 100644
--- a/app/workers/email_receiver_worker.rb
+++ b/app/workers/email_receiver_worker.rb
@@ -40,6 +40,8 @@ class EmailReceiverWorker
"You are not allowed to perform this action. If you believe this is in error, contact a staff member."
when Gitlab::Email::NoteableNotFoundError
"The thread you are replying to no longer exists, perhaps it was deleted? If you believe this is in error, contact a staff member."
+ when Gitlab::Email::InvalidAttachment
+ error.message
when Gitlab::Email::InvalidRecordError
can_retry = true
error.message