Commit 7a9e1f53 authored by Igor Drozdov's avatar Igor Drozdov

Remove MergeRequest#target_branches and its usages

update_branches controller action has been removed in
244f511e

Now we can remove the view as well
The view was the only one which used @target_branches instance
variable, and this variable was the only one which used
MergeRequest#target_branches

The commit also remove the usage of MergeRequest#source_branches
Since we don't use that method anymore, we can delete it as well
parent 1e39f6f5
......@@ -16,7 +16,6 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap
end
def create
@target_branches ||= []
@merge_request = ::MergeRequests::CreateService.new(project, current_user, merge_request_params).execute
if @merge_request.valid?
......@@ -97,13 +96,6 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap
def define_new_vars
@noteable = @merge_request
@target_branches = if @merge_request.target_project
@merge_request.target_project.repository.branch_names
else
[]
end
@target_project = @merge_request.target_project
@source_project = @merge_request.source_project
......
......@@ -357,7 +357,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
def define_edit_vars
@source_project = @merge_request.source_project
@target_project = @merge_request.target_project
@target_branches = @merge_request.target_project.repository.branch_names
@noteable = @merge_request
# FIXME: We have to assign a presenter to another instance variable
......
......@@ -1129,26 +1129,6 @@ class MergeRequest < ApplicationRecord
end
end
# Return array of possible target branches
# depends on target project of MR
def target_branches
if target_project.nil?
[]
else
target_project.repository.branch_names
end
end
# Return array of possible source branches
# depends on source project of MR
def source_branches
if source_project.nil?
[]
else
source_project.repository.branch_names
end
end
def has_ci?
return false if has_no_commits?
......
= render 'projects/merge_requests/dropdowns/branch',
branches: @target_branches,
selected: nil
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