summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-01-06 20:59:38 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-01-06 20:59:38 +0800
commit593228ffe3b2e4ff82c4d63e5d5c59b835f70085 (patch)
tree8d77c888cb67c79fe6499546c4fbf8f40b80d248 /app
parentdea589d635d4c41fbf0db721b132ea466c34cb4a (diff)
downloadgitlab-ce-593228ffe3b2e4ff82c4d63e5d5c59b835f70085.tar.gz
Don't set invalid @mr_source_branch when create_merge_request?
Diffstat (limited to 'app')
-rw-r--r--app/controllers/concerns/creates_commit.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/controllers/concerns/creates_commit.rb b/app/controllers/concerns/creates_commit.rb
index f5f9cdeaec5..258791bb5cd 100644
--- a/app/controllers/concerns/creates_commit.rb
+++ b/app/controllers/concerns/creates_commit.rb
@@ -91,16 +91,13 @@ module CreatesCommit
@mr_source_project != @mr_target_project
end
- def different_branch?
- @mr_source_branch != @mr_target_branch || different_project?
- end
-
def create_merge_request?
- params[:create_merge_request].present? && different_branch?
+ params[:create_merge_request].present?
end
+ # TODO: We should really clean this up
def set_commit_variables
- @mr_source_branch ||= @target_branch
+ @mr_source_branch = @target_branch unless create_merge_request?
if can?(current_user, :push_code, @project)
# Edit file in this project