diff options
author | Marin Jankovski <marin@gitlab.com> | 2015-09-23 09:28:59 +0000 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2015-09-23 09:28:59 +0000 |
commit | 241ec7a5eedb687b0bc29830063ef4d2a87c8d6f (patch) | |
tree | 8936043784cbe05dcc9e8a8d739a912f3c4b3361 /app | |
parent | b4bedfdfb96b603cd3d97c19dccc32b75c1b26ab (diff) | |
parent | d80750b50f8f3c85c04f9aad6c3dd23003385de1 (diff) | |
download | gitlab-ce-241ec7a5eedb687b0bc29830063ef4d2a87c8d6f.tar.gz |
Merge branch 'fix-mr-missing-source-branch-error' into 'master'
Fix error when MR source branch no longer exists.
See merge request !1393
Diffstat (limited to 'app')
-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 |