diff options
author | Stan Hu <stanhu@gmail.com> | 2015-10-15 01:57:45 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-10-15 23:54:13 -0700 |
commit | 22775c596f9f8be79ec7599b561aa0ccb40bdc42 (patch) | |
tree | a23d6d4149c133f88fdf8b342ce088944caf4fdd /app/services/merge_requests | |
parent | 2611d9f63cb6c22a00eccdac75535f93890b176c (diff) | |
download | gitlab-ce-22775c596f9f8be79ec7599b561aa0ccb40bdc42.tar.gz |
Preserve target branch
Diffstat (limited to 'app/services/merge_requests')
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index 802d02b0790..8139aef2bb9 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -55,7 +55,11 @@ module MergeRequests # Refresh merge request diff if we push to source or target branch of merge request # Note: we should update merge requests from forks too def reload_merge_requests - @merge_requests.each do |merge_request| + merge_requests = @project.merge_requests.opened.by_branch(@branch_name).to_a + merge_requests += @fork_merge_requests.by_branch(@branch_name).to_a + merge_requests = filter_merge_requests(merge_requests) + + merge_requests.each do |merge_request| if merge_request.source_branch == @branch_name || force_push? merge_request.reload_code |