Commit 3c476ee6 authored by Mark Fletcher's avatar Mark Fletcher

Maintain "force_remove_source_branch" options on Merge Request unless specified

parent a053430e
...@@ -31,6 +31,7 @@ v 8.13.0 (unreleased) ...@@ -31,6 +31,7 @@ v 8.13.0 (unreleased)
- Update Gitlab Shell to fix some problems with moving projects between storages - Update Gitlab Shell to fix some problems with moving projects between storages
- Cache rendered markdown in the database, rather than Redis - Cache rendered markdown in the database, rather than Redis
- Avoid database queries on Banzai::ReferenceParser::BaseParser for nodes without references - Avoid database queries on Banzai::ReferenceParser::BaseParser for nodes without references
- Do not alter 'force_remove_source_branch' options on MergeRequest unless specified
- Simplify Mentionable concern instance methods - Simplify Mentionable concern instance methods
- API: Ability to retrieve version information (Robert Schilling) - API: Ability to retrieve version information (Robert Schilling)
- Fix permission for setting an issue's due date - Fix permission for setting an issue's due date
......
...@@ -15,7 +15,10 @@ module MergeRequests ...@@ -15,7 +15,10 @@ module MergeRequests
params.except!(:target_branch, :force_remove_source_branch) params.except!(:target_branch, :force_remove_source_branch)
end end
if params[:force_remove_source_branch].present?
merge_request.merge_params['force_remove_source_branch'] = params.delete(:force_remove_source_branch) merge_request.merge_params['force_remove_source_branch'] = params.delete(:force_remove_source_branch)
end
handle_wip_event(merge_request) handle_wip_event(merge_request)
update(merge_request) update(merge_request)
end end
......
...@@ -105,6 +105,18 @@ describe MergeRequests::UpdateService, services: true do ...@@ -105,6 +105,18 @@ describe MergeRequests::UpdateService, services: true do
expect(note).not_to be_nil expect(note).not_to be_nil
expect(note.note).to eq 'Target branch changed from `master` to `target`' expect(note.note).to eq 'Target branch changed from `master` to `target`'
end end
context 'when not including source branch removal options' do
before do
opts.delete(:force_remove_source_branch)
end
it 'maintains the original options' do
update_merge_request(opts)
expect(@merge_request.merge_params["force_remove_source_branch"]).to eq("1")
end
end
end end
context 'todos' do context 'todos' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment