summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-12-14 03:33:43 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-12-14 03:40:09 +0800
commit99b556976370bfe0c052d15b6a8f0642256173fd (patch)
treefa208187006d015926300140923f1ddde141f575
parent56d131dcd52cba98e0eee253cab8bbf0b3b706df (diff)
downloadgitlab-ce-99b556976370bfe0c052d15b6a8f0642256173fd.tar.gz
Try to use those @mr variables for full correctness
-rw-r--r--app/controllers/concerns/creates_commit.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/concerns/creates_commit.rb b/app/controllers/concerns/creates_commit.rb
index a94077c2bd4..f0e6fc4b3e8 100644
--- a/app/controllers/concerns/creates_commit.rb
+++ b/app/controllers/concerns/creates_commit.rb
@@ -4,14 +4,16 @@ module CreatesCommit
def create_commit(service, success_path:, failure_path:, failure_view: nil, success_notice: nil)
set_commit_variables
- source_branch = @ref if @ref && @repository.find_branch(@ref)
+ source_branch = @ref if @ref &&
+ @mr_source_project.repository.branch_exists?(@ref)
commit_params = @commit_params.merge(
- source_project: @tree_edit_project,
+ source_project: @mr_source_project,
source_branch: source_branch,
- target_branch: @target_branch
+ target_branch: @mr_target_branch
)
- result = service.new(@project, current_user, commit_params).execute
+ result = service.new(
+ @mr_target_project, current_user, commit_params).execute
if result[:status] == :success
update_flash_notice(success_notice)