Commit eb242fc8 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Make sure different project gets a merge request

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_21626479
parent 406dfd6e
......@@ -93,8 +93,10 @@ module CreatesCommit
def create_merge_request?
# XXX: Even if the field is set, if we're checking the same branch
# as the target branch, we don't want to create a merge request.
params[:create_merge_request].present? && @ref != @target_branch
# as the target branch in the same project,
# we don't want to create a merge request.
params[:create_merge_request].present? &&
(different_project? || @ref != @target_branch)
end
# TODO: We should really clean this up
......
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