Commit 0b3b56b3 authored by Lin Jen-Shin's avatar Lin Jen-Shin

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.
parent 9244c81b
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment