diff options
author | Jacob Carlborg <jacob.carlborg@tretti.se> | 2013-11-28 09:45:35 +0100 |
---|---|---|
committer | Jacob Carlborg <doob@me.com> | 2014-02-24 22:06:25 +0100 |
commit | 9439cb55260185b4a456982613f657f3c1b11915 (patch) | |
tree | cff49cb624021d9508b7dc390ad0573e46225c21 /app/controllers/projects | |
parent | 504777ec20f006fd92cc948c03d35df3e1df4d3b (diff) | |
download | gitlab-ce-9439cb55260185b4a456982613f657f3c1b11915.tar.gz |
By default, target original repository if fork when creating new MR.
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 2b410c5a610..4e07a7af386 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -60,7 +60,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController def new @merge_request = MergeRequest.new(params[:merge_request]) @merge_request.source_project = @project unless @merge_request.source_project - @merge_request.target_project = @project unless @merge_request.target_project + @merge_request.target_project ||= (@project.forked_from_project || @project) + @target_branches = @merge_request.target_project.nil? ? [] : @merge_request.target_project.repository.branch_names + + @merge_request.target_branch ||= @merge_request.target_project.default_branch + @source_project = @merge_request.source_project @merge_request end |