Commit b08b2cf2 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'id-remove-update-branches' into 'master'

Remove MergeRequest#target_branches and its usages

See merge request gitlab-org/gitlab!30216
parents 8b687c88 7a9e1f53
......@@ -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