branch: master
commit 8f87f740e211a47cdcffa1b4fe086ba5240472fb
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-git-grep): Update for Windows
Don't count on Windows having awk and sed.
This makes it possible to use `counsel-git-grep' even without Cygwin,
just having `git' from the "Git for Windows" build in the PATH is
enough.
Of course, it won't work well for huge repositories.
---
counsel.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/counsel.el b/counsel.el
index 1708753..fda6d0e 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1030,7 +1030,10 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
(if (null counsel--git-grep-dir)
(error "Not in a git repository")
(unless proj
- (setq counsel--git-grep-count (counsel--gg-count "" t)))
+ (setq counsel--git-grep-count
+ (if (eq system-type 'windows-nt)
+ 0
+ (counsel--gg-count "" t))))
(ivy-read "git grep" (if proj
'counsel-git-grep-proj-function
'counsel-git-grep-function)