Make sure different project gets a merge request

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_21626479
This commit is contained in:
Lin Jen-Shin 2017-01-26 22:37:22 +08:00
parent 406dfd6e0f
commit eb242fc865

View file

@ -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