2014-01-24 07:18:32 -05:00
|
|
|
module MergeRequests
|
|
|
|
# MergeService class
|
|
|
|
#
|
|
|
|
# Mark existing merge request as merged
|
|
|
|
# and execute all hooks and notifications
|
|
|
|
# Called when you do merge via command line and push code
|
|
|
|
# to target branch
|
|
|
|
class MergeService < BaseMergeService
|
|
|
|
def execute(merge_request, current_user, commit_message)
|
|
|
|
merge_request.merge
|
|
|
|
|
2014-03-25 07:47:48 -04:00
|
|
|
notification.merge_mr(merge_request, current_user)
|
2014-03-25 08:01:52 -04:00
|
|
|
create_merge_event(merge_request, current_user)
|
2014-01-24 07:18:32 -05:00
|
|
|
execute_project_hooks(merge_request)
|
|
|
|
|
|
|
|
true
|
|
|
|
rescue
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|