diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-10-24 19:01:44 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-11-07 18:27:55 +0300 |
commit | 6fbdc5ed5224154b89cf351e11a8f9db48e6d7f0 (patch) | |
tree | dd2ccecd4b1100d4b83f91292b96ec988eecde6d /spec/fixtures/patchfiles | |
parent | 6d8810a64f944ff96af54e5c759f866bb68a7453 (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 'spec/fixtures/patchfiles')
-rw-r--r-- | spec/fixtures/patchfiles/0001-A-commit-from-a-patch.patch | 19 | ||||
-rw-r--r-- | spec/fixtures/patchfiles/0001-This-does-not-apply-to-the-feature-branch.patch | 23 |
2 files changed, 42 insertions, 0 deletions
diff --git a/spec/fixtures/patchfiles/0001-A-commit-from-a-patch.patch b/spec/fixtures/patchfiles/0001-A-commit-from-a-patch.patch new file mode 100644 index 00000000000..cc38682a0ab --- /dev/null +++ b/spec/fixtures/patchfiles/0001-A-commit-from-a-patch.patch @@ -0,0 +1,19 @@ +From 3fee0042e610fb3563e4379e316704cb1210f3de Mon Sep 17 00:00:00 2001 +From: Patch User <patchuser@gitlab.org> +Date: Thu, 18 Oct 2018 13:40:35 +0200 +Subject: [PATCH] A commit from a patch + +--- + README | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/README b/README +index 3742e48..e40a3b9 100644 +--- a/README ++++ b/README +@@ -1 +1,3 @@ + Sample repo for testing gitlab features ++ ++This was applied in a patch! +-- +2.19.1 diff --git a/spec/fixtures/patchfiles/0001-This-does-not-apply-to-the-feature-branch.patch b/spec/fixtures/patchfiles/0001-This-does-not-apply-to-the-feature-branch.patch new file mode 100644 index 00000000000..905002ae898 --- /dev/null +++ b/spec/fixtures/patchfiles/0001-This-does-not-apply-to-the-feature-branch.patch @@ -0,0 +1,23 @@ +From 00c68c2b4f954370ce82a1162bc29c13f524897e Mon Sep 17 00:00:00 2001 +From: Patch User <patchuser@gitlab.org> +Date: Mon, 22 Oct 2018 11:05:48 +0200 +Subject: [PATCH] This does not apply to the `feature` branch + +--- + files/ruby/feature.rb | 5 +++++ + 1 file changed, 5 insertions(+) + create mode 100644 files/ruby/feature.rb + +diff --git a/files/ruby/feature.rb b/files/ruby/feature.rb +new file mode 100644 +index 0000000..fef26e4 +--- /dev/null ++++ b/files/ruby/feature.rb +@@ -0,0 +1,5 @@ ++class Feature ++ def bar ++ puts 'foo' ++ end ++end +-- +2.19.1 |