Commit b3b8243c authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '327308-unable-to-edit-mr-with-unchecked-mergeability-state' into 'master'

Don't mark already unchecked merge requests as unchecked

See merge request gitlab-org/gitlab!61759
parents 8d72653a 4e598925
...@@ -49,7 +49,7 @@ module MergeRequests ...@@ -49,7 +49,7 @@ module MergeRequests
# #
if merge_request.previous_changes.include?('target_branch') || if merge_request.previous_changes.include?('target_branch') ||
merge_request.previous_changes.include?('source_branch') merge_request.previous_changes.include?('source_branch')
merge_request.mark_as_unchecked merge_request.mark_as_unchecked unless merge_request.unchecked?
end end
end end
......
...@@ -768,6 +768,13 @@ RSpec.describe MergeRequests::UpdateService, :mailer do ...@@ -768,6 +768,13 @@ RSpec.describe MergeRequests::UpdateService, :mailer do
update_merge_request({ target_branch: 'target' }) update_merge_request({ target_branch: 'target' })
end end
it "does not try to mark as unchecked if it's already unchecked" do
expect(merge_request).to receive(:unchecked?).and_return(true)
expect(merge_request).not_to receive(:mark_as_unchecked)
update_merge_request({ target_branch: "target" })
end
end end
context 'when auto merge is enabled and target branch changed' do context 'when auto merge is enabled and target branch changed' 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