branch: master
commit d020a7ba446d518f8fea5cab34410328fe1d3a74
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-rg): Search whole Git repository
The previous behavior was to search the current directory, not very
convenient.
---
counsel.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/counsel.el b/counsel.el
index 1b2a7c3..722d9e8 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2024,7 +2024,9 @@ RG-PROMPT, if non-nil, is passed as `ivy-read' prompt
argument."
" in directory: ")))))
(counsel-require-program (car (split-string counsel-rg-base-command)))
(ivy-set-prompt 'counsel-rg counsel-prompt-function)
- (setq counsel--git-grep-dir (or initial-directory default-directory))
+ (setq counsel--git-grep-dir (or initial-directory
+ (locate-dominating-file default-directory
".git")
+ default-directory))
(ivy-read (or rg-prompt (car (split-string counsel-rg-base-command)))
(lambda (string)
(counsel-ag-function string counsel-rg-base-command
extra-rg-args))