Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4e598925
Commit
4e598925
authored
May 13, 2021
by
Gary Holtz
Committed by
Douglas Barbosa Alexandre
May 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a conditional to not uncheck an unchecked MR
Changelog: fixed
parent
97a0cae1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/services/merge_requests/update_service.rb
app/services/merge_requests/update_service.rb
+1
-1
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+7
-0
No files found.
app/services/merge_requests/update_service.rb
View file @
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
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
4e598925
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment