Read about our upcoming Code of Conduct on this issue

Unverified Commit ccd842c3 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Prevent post-receive error when push to project with dead forks

If project has open merge request from fork and this fork was removed
before merge request was closed it cause exception during push
Signed-off-by: default avatarDmitriy Zaporozhets <>
parent ccbd52f9f837
......@@ -411,7 +411,7 @@ def update_merge_requests(oldrev, newrev, ref, user)
mrs = self.merge_requests.opened.where(target_branch: branch_name).to_a
mrs = { |mr| c_ids.include?( }
mrs.uniq.each do |merge_request| do |merge_request|, user, nil)
......@@ -420,7 +420,7 @@ def update_merge_requests(oldrev, newrev, ref, user)
# Update code for merge requests between project and project fork
mrs += self.fork_merge_requests.opened.by_branch(branch_name).to_a
mrs.uniq.each do |merge_request| do |merge_request|
......@@ -435,7 +435,7 @@ def comment_mr_with_commits(branch_name, commits, user)
mrs = self.origin_merge_requests.opened.where(source_branch: branch_name).to_a
mrs += self.fork_merge_requests.opened.where(source_branch: branch_name).to_a
mrs.uniq.each do |merge_request| do |merge_request|
Note.create_new_commits_note(merge_request, merge_request.project,
user, commits)
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