diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-08-14 18:52:49 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-08-14 18:52:49 +0300 |
commit | 9ea37cda3fa5e0aacf265bcb7739c1d4240f3bdc (patch) | |
tree | d4557426face47298c0195ae9c72efe42f99b69d /app/services/merge_requests/merge_service.rb | |
parent | f4149bcddca9c0e7aac078b3e7c198f5624ea107 (diff) |
merge with support of pre-receive and post-receive hooks
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/services/merge_requests/merge_service.rb')
-rw-r--r-- | app/services/merge_requests/merge_service.rb | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/app/services/merge_requests/merge_service.rb b/app/services/merge_requests/merge_service.rb index 2107529a21a..98a67c0bc99 100644 --- a/app/services/merge_requests/merge_service.rb +++ b/app/services/merge_requests/merge_service.rb @@ -17,7 +17,7 @@ module MergeRequests end merge_request.in_locked_state do - if merge_changes + if commit after_merge success else @@ -28,12 +28,6 @@ module MergeRequests private - def merge_changes - if sha = commit - after_commit(sha, merge_request.target_branch) - end - end - def commit committer = repository.user_to_comitter(current_user) @@ -43,11 +37,7 @@ module MergeRequests committer: committer } - repository.merge(merge_request.source_sha, merge_request.target_branch, options) - end - - def after_commit(sha, branch) - PostCommitService.new(project, current_user).execute(sha, branch) + repository.merge(current_user, merge_request.source_sha, merge_request.target_branch, options) end def after_merge |