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/services/commits/create_service.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/services/commits/create_service.rb')
-rw-r--r--app/services/commits/create_service.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/services/commits/create_service.rb b/app/services/commits/create_service.rb
index 3ce9acc833c..34593e12bd5 100644
--- a/app/services/commits/create_service.rb
+++ b/app/services/commits/create_service.rb
@@ -19,7 +19,12 @@ module Commits
new_commit = create_commit!
success(result: new_commit)
- rescue ValidationError, ChangeError, Gitlab::Git::Index::IndexError, Gitlab::Git::CommitError, Gitlab::Git::PreReceiveError => ex
+ rescue ValidationError,
+ ChangeError,
+ Gitlab::Git::Index::IndexError,
+ Gitlab::Git::CommitError,
+ Gitlab::Git::PreReceiveError,
+ Gitlab::Git::CommandError => ex
error(ex.message)
end