Commit 4714cb58 authored by Micaël Bergeron's avatar Micaël Bergeron

fix the failing spec

don't fallback on the upstream project if the project isn't a fork.
parent 24c2a6bf
......@@ -36,9 +36,11 @@ module EE
def clamp_approvals_before_merge(mr_params)
return mr_params unless mr_params[:approvals_before_merge]
# target the MR target project in priority, else it depends wether the project
# is forked.
target_project = if @merge_request
@merge_request.target_project
elsif @project.id.to_s != mr_params[:target_project_id]
elsif @project.forked? && @project.id.to_s != mr_params[:target_project_id]
@project.forked_from_project
else
@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