diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-24 00:06:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-24 00:06:17 +0300 |
commit | 11faf8ae72dcdbaff31f97410a3a9319324438fd (patch) | |
tree | 2dc680f52ef8b2355c9097dfd1bbeb5ba899df3c /app/services | |
parent | 7f0a4a64d0bc59b184ae3ee578adb6ebd3c48bf7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/merge_requests/build_service.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/services/merge_requests/build_service.rb b/app/services/merge_requests/build_service.rb index 214f145d09b..06ee25eac2a 100644 --- a/app/services/merge_requests/build_service.rb +++ b/app/services/merge_requests/build_service.rb @@ -10,13 +10,20 @@ module MergeRequests # TODO: this should handle all quick actions that don't have side effects # https://gitlab.com/gitlab-org/gitlab-foss/issues/53658 merge_quick_actions_into_params!(merge_request, only: [:target_branch]) - merge_request.merge_params['force_remove_source_branch'] = params.delete(:force_remove_source_branch) if params.has_key?(:force_remove_source_branch) # Assign the projects first so we can use policies for `filter_params` merge_request.author = current_user merge_request.source_project = find_source_project merge_request.target_project = find_target_project + # Source project sets the default source branch removal setting + merge_request.merge_params['force_remove_source_branch'] = + if params.key?(:force_remove_source_branch) + params.delete(:force_remove_source_branch) + else + merge_request.source_project.remove_source_branch_after_merge? + end + filter_params(merge_request) # merge_request.assign_attributes(...) below is a Rails |