2014-04-02 14:51:17 -04:00
|
|
|
module MergeRequests
|
|
|
|
class CloseService < MergeRequests::BaseService
|
|
|
|
def execute(merge_request, commit = nil)
|
|
|
|
# If we close MergeRequest we want to ignore validation
|
|
|
|
# so we can close broken one (Ex. fork project removed)
|
|
|
|
merge_request.allow_broken = true
|
|
|
|
|
|
|
|
if merge_request.close
|
|
|
|
event_service.close_mr(merge_request, current_user)
|
|
|
|
create_note(merge_request)
|
2015-01-26 01:49:05 -05:00
|
|
|
notification_service.close_mr(merge_request, current_user)
|
2015-01-17 19:34:34 -05:00
|
|
|
execute_hooks(merge_request, 'close')
|
2014-04-02 14:51:17 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
merge_request
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|