Commit 718817fd authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'handle-bad-head' into 'master'

Fix Error 500 occuring with repositories that have a bad HEAD

A repository could have objects but no valid HEAD, causing `project.commit` to be `nil`.

See merge request !1433
parents d5e73ae6 04de85a9
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
= project.name = project.name
.project-controls .project-controls
- if ci && !project.empty_repo? - if ci && !project.empty_repo? && project.commit
- if ci_commit = project.ci_commit(project.commit.sha) - if ci_commit = project.ci_commit(project.commit.sha)
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}", = link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}",
title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do
......
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