def find_page_in_tree(map, name, checked_dir = nil, exact = false)
      return nil if !map || name.to_s.empty?

      checked_dir = BlobEntry.normalize_dir(checked_dir)
      checked_dir = '' if exact && checked_dir.nil?
      name        = ::File.join(checked_dir, name) if checked_dir

      map.each do |entry|
        next if entry.name.to_s.empty?
        path = checked_dir ? ::File.join(entry.dir, entry.name) : entry.name
        next unless page_match(name, path)
        return entry.page(@wiki, @version)
      end

      return nil # nothing was found
    end
def find_page_in_tree(map, name, checked_dir = nil, exact = false)
      return nil if !map || name.to_s.empty?

      checked_dir = BlobEntry.normalize_dir(checked_dir)
      checked_dir = '' if exact && checked_dir.nil?
      name        = ::File.join(checked_dir, name) if checked_dir

      map.each do |entry|
        next if entry.name.to_s.empty?
        path = checked_dir ? ::File.join(entry.dir, entry.name) : entry.name
        next unless page_match(name, path)
        return entry.page(@wiki, @version)
      end

      return nil # nothing was found
    end
Find a page in a given tree.

 map         - The Array tree map from Wiki#tree_map.
 name        - The canonical String page name.
 checked_dir - Optional String of the directory a matching page needs
               to be in.  The string should

 Returns a Gollum::Page or nil if the page could not be found.