3e259ea8bc
This reverts commit5daf44b7c8
, reversing changes made to2f706fbd23
.
22 lines
621 B
Ruby
22 lines
621 B
Ruby
module MergeRequests
|
|
# PostMergeService class
|
|
#
|
|
# Mark existing merge request as merged
|
|
# and execute all hooks and notifications
|
|
#
|
|
class PostMergeService < MergeRequests::BaseService
|
|
def execute(merge_request)
|
|
merge_request.mark_as_merged
|
|
create_merge_event(merge_request, current_user)
|
|
create_note(merge_request)
|
|
notification_service.merge_mr(merge_request, current_user)
|
|
execute_hooks(merge_request, 'merge')
|
|
end
|
|
|
|
private
|
|
|
|
def create_merge_event(merge_request, current_user)
|
|
EventCreateService.new.merge_mr(merge_request, current_user)
|
|
end
|
|
end
|
|
end
|