leonid-shevtsov/SearchInProject_SublimeText2 — pull request #5 by nzbart (2013-07-14 01:02:01+00:00)
Title: Use first folder as cwd for git grep

The git-grep search did not work for me on Windows (it may on other O/Ses) because git on Windows must be run with its working directory set to a directory within the repository to search. There are no arguments you can pass to search from outside a repository.

I am not particularly happy with the fix, but am 100% open to suggestions on how I can improve it. Bear in mind that my python skillz are non existent and this is the first Sublime plugin I've edited. This fix will not work with more than one folder in a project. Making it work would probably require executing git grep multiple times and combining the results. I also do not like the method of removing quotes - it would be better to pass in an unquoted folder string.

However: this simple works for my simple scenario.