diff options
author | Stan Hu <stanhu@gmail.com> | 2018-10-06 14:53:08 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-10-06 14:53:08 +0300 |
commit | bedd5769e936fecc528a2bde49f48dea3966cd1f (patch) | |
tree | 1632614a9a252eadf5a2ebecd43b6757abefa4e7 /app | |
parent | 1239629cd747e8f1eeae61174ff1b7d5b08359b9 (diff) | |
parent | 9f9cac67ab7292be0037082120f0995152624599 (diff) |
Merge branch 'backport-ce-to-ee-merge' into 'master'
Backport of CE upstream - 2018-10-05 12:21 UTC
See merge request gitlab-org/gitlab-ce!22154
Diffstat (limited to 'app')
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index d3e4f3def23..b03d14fa3cc 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -3,16 +3,17 @@ module MergeRequests class RefreshService < MergeRequests::BaseService def execute(oldrev, newrev, ref) - @push = Gitlab::Git::Push.new(@project, oldrev, newrev, ref) + push = Gitlab::Git::Push.new(@project, oldrev, newrev, ref) + return true unless push.branch_push? - return true unless @push.branch_push? - - refresh_merge_requests! + refresh_merge_requests!(push) end private - def refresh_merge_requests! + def refresh_merge_requests!(push) + @push = push + Gitlab::GitalyClient.allow_n_plus_1_calls(&method(:find_new_commits)) # Be sure to close outstanding MRs before reloading them to avoid generating an # empty diff during a manual merge |