Fix error when MR source branch no longer exists.
This commit is contained in:
parent
0ce5fb71b6
commit
d80750b50f
2 changed files with 2 additions and 3 deletions
|
@ -258,7 +258,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
|
|||
@commits = @merge_request.commits
|
||||
|
||||
@merge_request_diff = @merge_request.merge_request_diff
|
||||
@source_branch = @merge_request.source_project.repository.find_branch(@merge_request.source_branch).try(:name)
|
||||
|
||||
if @merge_request.locked_long_ago?
|
||||
@merge_request.unlock_mr
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
The changes were merged into
|
||||
%span.label-branch= @merge_request.target_branch
|
||||
You can remove the source branch now.
|
||||
= link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do
|
||||
= link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do
|
||||
%i.fa.fa-times
|
||||
Remove Source Branch
|
||||
|
||||
|
|
Loading…
Reference in a new issue