diff --git a/app/roles/repository.rb b/app/roles/repository.rb index 882ec31033c772d3eb51b88e7a1b53649285d1da..8942eaea7541b29fe6bda3c7cb914d12126ad9e9 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 f85b6e4b865c16b6ac8ffabc6cde667202497abf..c742fb3365a26e5041c10b671b261a2951950249 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