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,6 +137,8 @@ module Repository
137 137
138 def has_commits? 138 def has_commits?
139 !!commit 139 !!commit
  140 + rescue Grit::NoSuchPathError
  141 + false
140 end 142 end
141 143
142 def root_ref 144 def root_ref
app/views/admin/projects/show.html.haml
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 %i.icon-edit 5 %i.icon-edit
6 Edit 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 %br 9 %br
10 .alert.alert-error 10 .alert.alert-error
11 %span 11 %span