diff options
author | Rémy Coutable <remy@rymai.me> | 2016-03-18 09:28:41 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-03-18 09:34:12 +0100 |
commit | b165b133eea72d01221254196b3ff82299d683c9 (patch) | |
tree | 6c6d7ae16096827dbcba68f78e6f3234354f3e53 | |
parent | 8edb133f7b03f182051482e62fd299a1f2083de8 (diff) | |
download | gitlab-ce-b165b133eea72d01221254196b3ff82299d683c9.tar.gz |
Fix an issue when the target branch of a MR had been deletedfix/14388
Before displaying the "diverged commits" note, we're checking if the MR
is open, but we should check if it's mergeable instead because this
check ensure the source and target branches exist.
This was introduced by !2217 and fixes #14388.
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_show.html.haml | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG index 102908102ef..0029cc60931 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -40,6 +40,7 @@ v 8.6.0 (unreleased) - Increase the notes polling timeout over time (Roberto Dip) - Add shortcut to toggle markdown preview (Florent Baldino) - Show labels in dashboard and group milestone views + - Fix an issue when the target branch of a MR had been deleted - Add main language of a project in the list of projects (Tiago Botelho) - Add ability to show archived projects on dashboard, explore and group pages - Move group activity to separate page diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml index ee5b9fd95a8..b9695157f68 100644 --- a/app/views/projects/merge_requests/_show.html.haml +++ b/app/views/projects/merge_requests/_show.html.haml @@ -34,7 +34,7 @@ %span into = link_to namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch" do = @merge_request.target_branch - - if @merge_request.open? && @merge_request.diverged_from_target_branch? + - if @merge_request.mergeable? && @merge_request.diverged_from_target_branch? %span (#{pluralize(@merge_request.diverged_commits_count, 'commit')} behind) = render "projects/merge_requests/show/how_to_merge" |