2014-04-02 14:51:17 -04:00
|
|
|
module MergeRequests
|
|
|
|
class ReopenService < MergeRequests::BaseService
|
|
|
|
def execute(merge_request)
|
2016-08-09 11:51:40 -04:00
|
|
|
return merge_request unless can?(current_user, :update_merge_request, merge_request)
|
|
|
|
|
2014-04-02 14:51:17 -04:00
|
|
|
if merge_request.reopen
|
|
|
|
event_service.reopen_mr(merge_request, current_user)
|
|
|
|
create_note(merge_request)
|
2015-01-26 01:49:05 -05:00
|
|
|
notification_service.reopen_mr(merge_request, current_user)
|
2015-01-17 19:34:34 -05:00
|
|
|
execute_hooks(merge_request, 'reopen')
|
2016-06-20 13:22:39 -04:00
|
|
|
merge_request.reload_diff
|
2014-04-02 14:51:17 -04:00
|
|
|
merge_request.mark_as_unchecked
|
|
|
|
end
|
|
|
|
|
|
|
|
merge_request
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|