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:
Darren Oakley
2012-07-09 13:01:40 +01:00
parent 50e494e8e9
commit 1cc9d7b647
+3 -2
View File
@@ -686,8 +686,9 @@ module Gollum
#
# Returns an Array of BlobEntry instances.
def tree_map_for(ref, ignore_page_file_dir=false)
if ignore_page_file_dir
GitAccess.new(path, nil, @repo_is_bare).tree(ref)
if ignore_page_file_dir && !@page_file_dir.nil?
@root_access ||= GitAccess.new(path, nil, @repo_is_bare)
@root_access.tree(ref)
else
@access.tree(ref)
end