Commit 632f8b0a authored by Kamil Trzciński's avatar Kamil Trzciński

Fix CE to EE merge

parent 8e453d75
...@@ -5,16 +5,17 @@ module MergeRequests ...@@ -5,16 +5,17 @@ module MergeRequests
prepend EE::MergeRequests::RefreshService prepend EE::MergeRequests::RefreshService
def execute(oldrev, newrev, ref) 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!(push)
refresh_merge_requests!
end end
private private
def refresh_merge_requests! def refresh_merge_requests!(push)
@push = push
Gitlab::GitalyClient.allow_n_plus_1_calls(&method(:find_new_commits)) Gitlab::GitalyClient.allow_n_plus_1_calls(&method(:find_new_commits))
# Be sure to close outstanding MRs before reloading them to avoid generating an # Be sure to close outstanding MRs before reloading them to avoid generating an
# empty diff during a manual merge # empty diff during a manual merge
......
...@@ -5,9 +5,9 @@ module EE ...@@ -5,9 +5,9 @@ module EE
private private
override :do_execute override :refresh_merge_requests!
def do_execute(oldrev, newrev, ref) def refresh_merge_requests!(push)
super && reset_approvals_for_merge_requests(ref, newrev) super && reset_approvals_for_merge_requests(push.ref, push.newrev)
end end
# Note: Closed merge requests also need approvals reset. # Note: Closed merge requests also need approvals reset.
......
...@@ -24,7 +24,7 @@ describe ApplicationHelper do ...@@ -24,7 +24,7 @@ describe ApplicationHelper do
let(:noteable_type) { Issue } let(:noteable_type) { Issue }
it 'returns paths for autocomplete_sources_controller' do it 'returns paths for autocomplete_sources_controller' do
expect_autocomplete_data_sources(object, noteable_type, [:members, :issues, :mergeRequests, :labels, :milestones, :commands]) expect_autocomplete_data_sources(object, noteable_type, [:members, :issues, :mergeRequests, :labels, :milestones, :commands, :snippets])
end end
end end
end end
......
...@@ -5,7 +5,7 @@ module Gitlab ...@@ -5,7 +5,7 @@ module Gitlab
class Push class Push
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
attr_reader :oldrev, :newrev attr_reader :ref, :oldrev, :newrev
def initialize(project, oldrev, newrev, ref) def initialize(project, oldrev, newrev, ref)
@project = project @project = project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment