Commit b2df61d8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix 500 error on admin project if empty

parent 9902f1af
...@@ -137,6 +137,8 @@ module Repository ...@@ -137,6 +137,8 @@ module Repository
def has_commits? def has_commits?
!!commit !!commit
rescue Grit::NoSuchPathError
false
end end
def root_ref def root_ref
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%i.icon-edit %i.icon-edit
Edit Edit
- if !@admin_project.has_post_receive_file? && @admin_project.commit - if !@admin_project.has_post_receive_file? && @admin_project.has_commits?
%br %br
.alert.alert-error .alert.alert-error
%span %span
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment