Fix #396.
Use ls-files to search file names (which define the page title).
This commit is contained in:
+11
-1
@@ -468,7 +468,7 @@ module Gollum
|
|||||||
args = [{}, '-i', '-c', query, @ref, '--']
|
args = [{}, '-i', '-c', query, @ref, '--']
|
||||||
args << '--' << @page_file_dir if @page_file_dir
|
args << '--' << @page_file_dir if @page_file_dir
|
||||||
|
|
||||||
@repo.git.grep(*args).split("\n").map! do |line|
|
results = @repo.git.grep(*args).split("\n").map! do |line|
|
||||||
result = line.split(':')
|
result = line.split(':')
|
||||||
file_name = result[1].gsub( ::File.extname(result[1]), '' )
|
file_name = result[1].gsub( ::File.extname(result[1]), '' )
|
||||||
|
|
||||||
@@ -477,6 +477,16 @@ module Gollum
|
|||||||
:name => file_name
|
:name => file_name
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Use git ls-files '*query*' to search for file names. Grep only searches file content.
|
||||||
|
results += @repo.git.ls_files({}, "*#{ query }*").split("\n").map! do |line|
|
||||||
|
{
|
||||||
|
:count => 1,
|
||||||
|
:name => line
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
results
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: All of the versions that have touched the Page.
|
# Public: All of the versions that have touched the Page.
|
||||||
|
|||||||
Reference in New Issue
Block a user