Commit 4e598925 authored by Gary Holtz's avatar Gary Holtz Committed by Douglas Barbosa Alexandre

Adds a conditional to not uncheck an unchecked MR

Changelog: fixed
parent 97a0cae1
......@@ -49,7 +49,7 @@ module MergeRequests
#
if merge_request.previous_changes.include?('target_branch') ||
merge_request.previous_changes.include?('source_branch')
merge_request.mark_as_unchecked
merge_request.mark_as_unchecked unless merge_request.unchecked?
end
end
......
......@@ -768,6 +768,13 @@ RSpec.describe MergeRequests::UpdateService, :mailer do
update_merge_request({ target_branch: 'target' })
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
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