From 83d383fe61683d2e5402db65673676da218199bb Mon Sep 17 00:00:00 2001 From: Troy Hinckley Date: Tue, 8 Sep 2020 15:06:33 -0700 Subject: [PATCH] Fix issue with git grep when no file extensions are specified Currently if no file extensions are specified then git grep will not be given a path and will therefore only search from the current directory instead of the root. So in that case we add the magic path (:/) to search from the project root. Note that this only works in Git versions greater then 1.7.6. --- dumb-jump.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dumb-jump.el b/dumb-jump.el index 00b5a72..f4dd4d0 100644 --- a/dumb-jump.el +++ b/dumb-jump.el @@ -2886,7 +2886,7 @@ Using ag to search only the files found via git-grep literal symbol search." (when (not (s-blank? dumb-jump-git-grep-search-args)) (concat " " dumb-jump-git-grep-search-args)) " -E")) - (fileexps (s-join " " (--map (shell-quote-argument (format "%s/*.%s" proj it)) ggtypes))) + (fileexps (s-join " " (or (--map (shell-quote-argument (format "%s/*.%s" proj it)) ggtypes) '(":/")))) (exclude-args (s-join " " (--map (shell-quote-argument (concat ":(exclude)" it)) exclude-paths)))