Fix searching for page titles.

This commit is contained in:
bootstraponline
2012-06-22 16:04:57 -06:00
parent 5e7974f30b
commit 7045f7f92d
+2 -1
View File
@@ -487,7 +487,8 @@ module Gollum
end
# Use git ls-files '*query*' to search for file names. Grep only searches file content.
@repo.git.ls_files({}, "*#{ query }*").split("\n").each do |line|
# Spaces are converted to dashes when saving pages to disk.
@repo.git.ls_files({}, "*#{ query.gsub(' ', '-') }*").split("\n").each do |line|
file_name = line.chomp(::File.extname(line))
# If there's not already a result for file_name then
# the value is nil and nil.to_i is 0.