Fix 500 error on admin project if empty

3-1-stable
Dmitriy Zaporozhets 2012-10-23 11:29:47 +03:00
parent 9902f1af6e
commit b2df61d85a
2 changed files with 3 additions and 1 deletions

View File

@ -137,6 +137,8 @@ module Repository
def has_commits?
!!commit
rescue Grit::NoSuchPathError
false
end
def root_ref

View File

@ -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