Gollum::Wiki#size returns 0 if the repo is invalid or empty

This commit is contained in:
rick
2010-10-11 17:40:09 -07:00
parent c0f8c897e7
commit e7b1265873
+2
View File
@@ -233,6 +233,8 @@ module Gollum
tree_map_for(ref || 'master').inject(0) do |num, entry|
num + (@page_class.valid_page_name?(entry.name) ? 1 : 0)
end
rescue Grit::GitRuby::Repository::NoSuchShaFound
0
end
# Public: Search all pages for this wiki.