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
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-04-15 20:55:45 +0300
committerStan Hu <stanhu@gmail.com>2019-04-15 21:27:33 +0300
commitd3fa9c9539aac42844a297a99ef56254ce1c06a3 (patch)
treeba94fe9d979a003585ede0c8f499030c731fa3f1 /lib
parent1a50801cd0801d3134b41e96ff2a6b27a96a1047 (diff)
Fix remove_source_branch merge request API handling
Users attempting to set merge requests to `remove_source_branch` to `false` would encounter an Error 500 because the UpdateService and API checked `present?`, which would always return `false`. We now just use `has_key?` to decide whether the parameter is present. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60530
Diffstat (limited to 'lib')
-rw-r--r--lib/api/merge_requests.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index 1cc0ecc6df8..ce85772e4ed 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -336,7 +336,7 @@ module API
merge_request = find_merge_request_with_access(params.delete(:merge_request_iid), :update_merge_request)
mr_params = declared_params(include_missing: false)
- mr_params[:force_remove_source_branch] = mr_params.delete(:remove_source_branch) if mr_params[:remove_source_branch].present?
+ mr_params[:force_remove_source_branch] = mr_params.delete(:remove_source_branch) if mr_params.has_key?(:remove_source_branch)
mr_params = convert_parameters_from_legacy_format(mr_params)
merge_request = ::MergeRequests::UpdateService.new(user_project, current_user, mr_params).execute(merge_request)