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
dfdd824d
Commit
dfdd824d
authored
Feb 23, 2021
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract #handle_target_branch_change method
parent
e3e41e2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
app/services/merge_requests/update_service.rb
app/services/merge_requests/update_service.rb
+15
-10
No files found.
app/services/merge_requests/update_service.rb
View file @
dfdd824d
...
...
@@ -43,16 +43,7 @@ module MergeRequests
todo_service
.
update_merge_request
(
merge_request
,
current_user
,
old_mentioned_users
)
end
if
merge_request
.
previous_changes
.
include?
(
'target_branch'
)
create_branch_change_note
(
merge_request
,
'target'
,
target_branch_was_deleted
?
'delete'
:
'update'
,
merge_request
.
previous_changes
[
'target_branch'
].
first
,
merge_request
.
target_branch
)
abort_auto_merge
(
merge_request
,
'target branch was changed'
)
end
handle_target_branch_change
(
merge_request
)
handle_assignees_change
(
merge_request
,
old_assignees
)
if
merge_request
.
assignees
!=
old_assignees
handle_reviewers_change
(
merge_request
,
old_reviewers
)
if
merge_request
.
reviewers
!=
old_reviewers
handle_milestone_change
(
merge_request
)
...
...
@@ -132,6 +123,20 @@ module MergeRequests
)
end
def
handle_target_branch_change
(
merge_request
)
return
unless
merge_request
.
previous_changes
.
include?
(
'target_branch'
)
create_branch_change_note
(
merge_request
,
'target'
,
target_branch_was_deleted
?
'delete'
:
'update'
,
merge_request
.
previous_changes
[
'target_branch'
].
first
,
merge_request
.
target_branch
)
abort_auto_merge
(
merge_request
,
'target branch was changed'
)
end
def
handle_draft_status_change
(
merge_request
,
changed_fields
)
return
unless
changed_fields
.
include?
(
"title"
)
...
...
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