Commit 2b555306 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Prevent 500 error if cant detect branches for commit

parent c2f74de4
...@@ -39,17 +39,18 @@ ...@@ -39,17 +39,18 @@
- @commit.parents.each do |parent| - @commit.parents.each do |parent|
= link_to parent.id[0...10], project_commit_path(@project, parent) = link_to parent.id[0...10], project_commit_path(@project, parent)
.commit-info-row - if @branches.any?
%span.cgray .commit-info-row
Exists in %span.cgray
%span Exists in
- branch = commit_default_branch(@project, @branches) %span
= link_to(branch, project_tree_path(@project, branch)) - branch = commit_default_branch(@project, @branches)
- if @branches.any? = link_to(branch, project_tree_path(@project, branch))
and in - if @branches.any?
= link_to("#{pluralize(@branches.count, "other branch")}", "#", class: "js-details-expand") and in
%span.js-details-contain.hide = link_to("#{pluralize(@branches.count, "other branch")}", "#", class: "js-details-expand")
= commit_branches_links(@project, @branches) %span.js-details-contain.hide
= commit_branches_links(@project, @branches)
.commit-box .commit-box
%h3.commit-title %h3.commit-title
......
...@@ -109,7 +109,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps ...@@ -109,7 +109,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end end
And 'I click on the first commit in the merge request' do And 'I click on the first commit in the merge request' do
click_link merge_request.commits.first.short_id(8) click_link merge_request.commits.first.short_id(8)
end end
......
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