diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-09-22 17:49:45 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-09-22 17:49:45 +0200 |
commit | d80750b50f8f3c85c04f9aad6c3dd23003385de1 (patch) | |
tree | 097e80845cf3da697f599391ebbd03b99614b22a | |
parent | 0ce5fb71b609ebf74d95b4027b8eb91beafa3db4 (diff) | |
download | gitlab-ce-d80750b50f8f3c85c04f9aad6c3dd23003385de1.tar.gz |
Fix error when MR source branch no longer exists.fix-mr-missing-source-branch-error
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 3 | ||||
-rw-r--r-- | app/views/projects/merge_requests/widget/_merged.html.haml | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index c1231994f25..7574842cd43 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -258,8 +258,7 @@ 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 @merge_request.close diff --git a/app/views/projects/merge_requests/widget/_merged.html.haml b/app/views/projects/merge_requests/widget/_merged.html.haml index d22dfa085b8..f223f687def 100644 --- a/app/views/projects/merge_requests/widget/_merged.html.haml +++ b/app/views/projects/merge_requests/widget/_merged.html.haml @@ -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 |