-
-
Notifications
You must be signed in to change notification settings - Fork 336
Closed
Description
If du outputs an error message, e.g. du: cannot read directory './doc': Permission denied then counsel-git-grep fails with Wrong type argument: number-or-marker-p, du:
Reproduction steps.
git clone https://github.com/abo-abo/swiper/
cd swiper
chmod 111 doc
make plain
and then invoke counsel-git-grep (C-c j) and observe the error.
Possible fix:
diff --git a/counsel.el b/counsel.el
index b601b90..5b4e992 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1232,7 +1232,7 @@ files in a project.")
"Default defun to calculate `counsel--git-grep-count'."
(if (eq system-type 'windows-nt)
0
- (read (shell-command-to-string "du -s"))))
+ (read (shell-command-to-string "du -s 2>/dev/null"))))
(defvar counsel--git-grep-count-func #'counsel--git-grep-count-func-default
"Defun to calculate `counsel--git-grep-count' for `counsel-git-grep'.")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels