summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-01-05 22:58:04 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-01-05 23:15:58 +0800
commit0b3b56b34d959322cced8a317138945c685015b8 (patch)
tree3271216983b2e398bd92c780c8530293951efc41
parent9244c81bc5f1c74966cb3ecb7b099fe7fd33689f (diff)
downloadgitlab-ce-0b3b56b34d959322cced8a317138945c685015b8.tar.gz
Merge request terms are reversed for GitOperationService
This is seriously confusing but a target branch in merge request, is actually the source branch for GitOperationService, which is the base branch. The source branch in a merge request, is the target branch for GitOperationService, which is where we want to make commits. Perhaps we should rename source branch in GitOperationService to base branch, and target branch to committing branch.
-rw-r--r--app/controllers/concerns/creates_commit.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/concerns/creates_commit.rb b/app/controllers/concerns/creates_commit.rb
index a2e1d7c4653..025fca088bf 100644
--- a/app/controllers/concerns/creates_commit.rb
+++ b/app/controllers/concerns/creates_commit.rb
@@ -5,15 +5,15 @@ module CreatesCommit
set_commit_variables
source_branch = @ref if
- @ref && @mr_source_project.repository.branch_exists?(@ref)
+ @ref && @mr_target_project.repository.branch_exists?(@ref)
commit_params = @commit_params.merge(
- source_project: @mr_source_project,
+ source_project: @mr_target_project,
source_branch: source_branch,
- target_branch: @mr_target_branch
+ target_branch: @mr_source_branch
)
result = service.new(
- @tree_edit_project, current_user, commit_params).execute
+ @mr_source_project, current_user, commit_params).execute
if result[:status] == :success
update_flash_notice(success_notice)