diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-23 23:48:46 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-23 23:48:46 -0800 |
commit | 8461c4b4d37db1a30ff620e8ca6f50af6c299a20 (patch) | |
tree | faf320577b8106c08607190c067c206dd2d2123d | |
parent | 9f9a79abe0f67c8c76f377171d2e1e2bc9e152ca (diff) | |
parent | de7c3291e9e7d4a8f542c912c7575ec97a3a78df (diff) | |
download | gitlab-ce-8461c4b4d37db1a30ff620e8ca6f50af6c299a20.tar.gz |
Merge pull request #8180 from Bugagazavr/mr_update
Trigger merge request hook when source updated
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index a6705de61f2..96761bec99f 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -53,7 +53,7 @@ module MergeRequests if merge_request.source_branch == @branch_name || force_push? merge_request.reload_code - merge_request.mark_as_unchecked + update_merge_request(merge_request) else mr_commit_ids = merge_request.commits.map(&:id) push_commit_ids = @commits.map(&:id) @@ -61,14 +61,20 @@ module MergeRequests if matches.any? merge_request.reload_code - merge_request.mark_as_unchecked + update_merge_request(merge_request) else - merge_request.mark_as_unchecked + update_merge_request(merge_request) end end end end + def update_merge_request(merge_request) + MergeRequests::UpdateService.new( + merge_request.target_project, + @current_user, merge_status: 'unchecked').execute(merge_request) + end + # Add comment about pushing new commits to merge requests def comment_mr_with_commits merge_requests = @project.origin_merge_requests.opened.where(source_branch: @branch_name).to_a |