diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-07 03:24:47 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-07 03:24:47 +0300 |
commit | ccdf08d80a64590f6188a3e36d68625e506b331c (patch) | |
tree | 704d910f8334e48e41868a37da42aa02573ed590 /app/services/merge_requests/merge_service.rb | |
parent | b55a0519acb34a764b2a350010aa813fd35b361e (diff) |
Refactor merge request merge service
* Add system note when user merges MR in same way as it closes it
* Remove duplicating code
Diffstat (limited to 'app/services/merge_requests/merge_service.rb')
-rw-r--r-- | app/services/merge_requests/merge_service.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/services/merge_requests/merge_service.rb b/app/services/merge_requests/merge_service.rb index 680766140bd..2dae3a19041 100644 --- a/app/services/merge_requests/merge_service.rb +++ b/app/services/merge_requests/merge_service.rb @@ -6,12 +6,14 @@ module MergeRequests # 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) + def execute(merge_request, commit_message) merge_request.merge - notification.merge_mr(merge_request, current_user) + binding.pry + notification_service.merge_mr(merge_request, current_user) create_merge_event(merge_request, current_user) - execute_project_hooks(merge_request) + create_note(merge_request) + execute_hooks(merge_request) true rescue |