summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-07-12 09:45:40 +0100
committerSean McGivern <sean@gitlab.com>2017-07-12 09:45:40 +0100
commit3ef80368839b9d295bfdf2b75b5ced1748884d0d (patch)
tree895545be765dd5ee03abbc5d34bf98ea7ea6b790
parentc17b1d5f5651b6f73b8c999bb6a5376e31a7d30d (diff)
downloadgitlab-ce-3ef80368839b9d295bfdf2b75b5ced1748884d0d.tar.gz
Backport MR create service changes from EEbackport-mr-create-service-changes
In EE, the `filter_params` method needs the MR to already have its `target_project` assigned.
-rw-r--r--app/services/merge_requests/create_service.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/services/merge_requests/create_service.rb b/app/services/merge_requests/create_service.rb
index 71d37797bb4..19189e64acf 100644
--- a/app/services/merge_requests/create_service.rb
+++ b/app/services/merge_requests/create_service.rb
@@ -7,9 +7,8 @@ module MergeRequests
source_project = @project
@project = Project.find(params[:target_project_id]) if params[:target_project_id]
- params[:target_project_id] ||= source_project.id
-
merge_request = MergeRequest.new
+ merge_request.target_project = @project
merge_request.source_project = source_project
merge_request.source_branch = params[:source_branch]
merge_request.merge_params['force_remove_source_branch'] = params.delete(:force_remove_source_branch)