summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-01-26 22:37:22 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-01-26 22:37:22 +0800
commiteb242fc865c032f6408f3b68700da9b840b416dd (patch)
tree83f8ee6b7b3d5ffa0a60c054e7f343930b4aba24 /app
parent406dfd6e0f39efc7c7310b968d5ed86461286e04 (diff)
downloadgitlab-ce-eb242fc865c032f6408f3b68700da9b840b416dd.tar.gz
Make sure different project gets a merge request
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_21626479
Diffstat (limited to 'app')
-rw-r--r--app/controllers/concerns/creates_commit.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/concerns/creates_commit.rb b/app/controllers/concerns/creates_commit.rb
index fa7c22b5388..6286d67d30c 100644
--- a/app/controllers/concerns/creates_commit.rb
+++ b/app/controllers/concerns/creates_commit.rb
@@ -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