Fix 500 error on admin project if empty
This commit is contained in:
parent
9902f1af6e
commit
b2df61d85a
2 changed files with 3 additions and 1 deletions
|
@ -137,6 +137,8 @@ module Repository
|
|||
|
||||
def has_commits?
|
||||
!!commit
|
||||
rescue Grit::NoSuchPathError
|
||||
false
|
||||
end
|
||||
|
||||
def root_ref
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue