diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-06 15:13:11 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-06 15:13:11 +0300 |
commit | 22d5e9855c776b32a79853548839211bba07f792 (patch) | |
tree | 5aecfc4a32e2a784211cfc1fa3d37b49ca791f66 /app | |
parent | 7af59c54fc1fcf9d19927e76be49318689684f8b (diff) | |
download | gitlab-ce-22d5e9855c776b32a79853548839211bba07f792.tar.gz |
When use change branches link at MR form - save source branch selection instead of target onemr-change-branches
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/merge_requests_helper.rb | 12 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_new_submit.html.haml | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index 54462fd00e3..45ee4fe4135 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -49,4 +49,16 @@ module MergeRequestsHelper def issues_sentence(issues) issues.map { |i| "##{i.iid}" }.to_sentence end + + def mr_change_branches_path(merge_request) + new_namespace_project_merge_request_path( + @project.namespace, @project, + merge_request: { + source_project_id: @merge_request.source_project_id, + target_project_id: @merge_request.target_project_id, + source_branch: @merge_request.source_branch, + target_branch: nil + } + ) + end end diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index 4e72458932c..6dc883ba22b 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -7,7 +7,7 @@ %strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch} %span.pull-right - = link_to 'Change branches', new_namespace_project_merge_request_path(@project.namespace, @project) + = link_to 'Change branches', mr_change_branches_path(@merge_request) = form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: "merge-request-form form-horizontal gfm-form" } do |f| .merge-request-form-info |