Commit b2df61d85ab295a9ba4585f667537a9afc3efc6a

Authored by Dmitriy Zaporozhets
1 parent 9902f1af

Fix 500 error on admin project if empty

app/roles/repository.rb
... ... @@ -137,6 +137,8 @@ module Repository
137 137  
138 138 def has_commits?
139 139 !!commit
  140 + rescue Grit::NoSuchPathError
  141 + false
140 142 end
141 143  
142 144 def root_ref
... ...
app/views/admin/projects/show.html.haml
... ... @@ -5,7 +5,7 @@
5 5 %i.icon-edit
6 6 Edit
7 7  
8   -- if !@admin_project.has_post_receive_file? && @admin_project.commit
  8 +- if !@admin_project.has_post_receive_file? && @admin_project.has_commits?
9 9 %br
10 10 .alert.alert-error
11 11 %span
... ...