Using Grit instead of backticked bash.
A bit unclear what's going on though, would be more explicit to say:
{:count => query}, however Grit::Git#transform_options converts to this
syntax:
`--count='query'` and `git grep` can't take this syntax, it has to be:
`git grep --count query`, and this is why we're using :c, and not
:count. As {:c => query} converts to: `git grep -c 'query'` which works
as expected.
Linked to this commit, for above information in comment.
Updated comment in Wiki.search to link describing commit.
This commit is contained in:
+2
-1
@@ -214,7 +214,8 @@ module Gollum
|
||||
#
|
||||
# Returns an Array with Objects of page name and count of matches
|
||||
def search(query)
|
||||
search_output = `cd #{$path} && git grep -c '#{query}' master`
|
||||
# See: http://github.com/Sirupsen/gollum/commit/f0a6f52bdaf6bee8253ca33bb3fceaeb27bfb87e
|
||||
search_output = @repo.git.grep({:c => query}, 'master')
|
||||
|
||||
search_output.split("\n").collect do |line|
|
||||
result = line.split(':')
|
||||
|
||||
Reference in New Issue
Block a user