diff --git a/app/roles/repository.rb b/app/roles/repository.rb index 882ec31..8942eae 100644 --- a/app/roles/repository.rb +++ b/app/roles/repository.rb @@ -137,6 +137,8 @@ module Repository 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 f85b6e4..c742fb3 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 -- libgit2 0.21.2