From b2df61d85ab295a9ba4585f667537a9afc3efc6a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 23 Oct 2012 11:29:47 +0300 Subject: [PATCH] Fix 500 error on admin project if empty --- app/roles/repository.rb | 2 ++ app/views/admin/projects/show.html.haml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/roles/repository.rb b/app/roles/repository.rb index 882ec31033c..8942eaea754 100644 --- a/app/roles/repository.rb +++ b/app/roles/repository.rb @@ -137,6 +137,8 @@ def discover_default_branch def has_commits? !!commit + rescue Grit::NoSuchPathError + false end def root_ref diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index f85b6e4b865..c742fb3365a 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -5,7 +5,7 @@ %i.icon-edit Edit -- if !@admin_project.has_post_receive_file? && @admin_project.commit +- if !@admin_project.has_post_receive_file? && @admin_project.has_commits? %br .alert.alert-error %span -- GitLab