Slight optimisations...
- only create a new GitAccess object if the wiki does not have a @page_file_dir directive - memoize the new GitAccess object
This commit is contained in:
+3
-2
@@ -686,8 +686,9 @@ module Gollum
|
|||||||
#
|
#
|
||||||
# Returns an Array of BlobEntry instances.
|
# Returns an Array of BlobEntry instances.
|
||||||
def tree_map_for(ref, ignore_page_file_dir=false)
|
def tree_map_for(ref, ignore_page_file_dir=false)
|
||||||
if ignore_page_file_dir
|
if ignore_page_file_dir && !@page_file_dir.nil?
|
||||||
GitAccess.new(path, nil, @repo_is_bare).tree(ref)
|
@root_access ||= GitAccess.new(path, nil, @repo_is_bare)
|
||||||
|
@root_access.tree(ref)
|
||||||
else
|
else
|
||||||
@access.tree(ref)
|
@access.tree(ref)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user