]> code.delx.au - gnu-emacs-elpa/commitdiff
counsel.el (counsel-git-grep): Fix the default-directory
authorOleh Krehel <ohwoeowho@gmail.com>
Sun, 19 Apr 2015 12:18:55 +0000 (14:18 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Sun, 19 Apr 2015 12:18:55 +0000 (14:18 +0200)
counsel.el

index a2a0ad4a583f9fe6760d0b84808653e4da9aeb2d..33364f7ad259276e9c218f3ed270e3a5ed41d2ae 100644 (file)
 (defun counsel-git-grep ()
   "Grep for a string in the current git repository."
   (interactive)
-  (let ((val (ivy-read "pattern: " 'counsel-git-grep-function))
+  (let ((default-directory (locate-dominating-file
+                             default-directory ".git"))
+        (val (ivy-read "pattern: " 'counsel-git-grep-function))
         lst)
     (when val
       (setq lst (split-string val ":"))