diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-10-05 18:35:59 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-10-05 18:39:42 +0300 |
commit | 9f9cac67ab7292be0037082120f0995152624599 (patch) | |
tree | 97bf024258da5008e0040e1b2ab5256f7a6e58d8 | |
parent | 393331b40bc9044b658896028869d29eed126a71 (diff) |
Fix CE to EE merge (backport)
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 11 | ||||
-rw-r--r-- | lib/gitlab/git/push.rb | 2 |
2 files changed, 7 insertions, 6 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 diff --git a/lib/gitlab/git/push.rb b/lib/gitlab/git/push.rb index 7c1309721fd..b6577ba17f1 100644 --- a/lib/gitlab/git/push.rb +++ b/lib/gitlab/git/push.rb @@ -5,7 +5,7 @@ module Gitlab class Push include Gitlab::Utils::StrongMemoize - attr_reader :oldrev, :newrev + attr_reader :ref, :oldrev, :newrev def initialize(project, oldrev, newrev, ref) @project = project |