Wiki#tree_list returns an empty array if the ref doesnt resolve
Signed-off-by: risk <technoweenie@gmail.com>
This commit is contained in:
+8
-5
@@ -520,11 +520,14 @@ module Gollum
|
|||||||
#
|
#
|
||||||
# Returns a flat Array of Gollum::Page instances.
|
# Returns a flat Array of Gollum::Page instances.
|
||||||
def tree_list(ref)
|
def tree_list(ref)
|
||||||
sha = @access.ref_to_sha(ref)
|
if sha = @access.ref_to_sha(ref)
|
||||||
commit = @access.commit(sha)
|
commit = @access.commit(sha)
|
||||||
tree_map_for(sha).inject([]) do |list, entry|
|
tree_map_for(sha).inject([]) do |list, entry|
|
||||||
next list unless @page_class.valid_page_name?(entry.name)
|
next list unless @page_class.valid_page_name?(entry.name)
|
||||||
list << entry.page(self, commit)
|
list << entry.page(self, commit)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
[]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user