Skip to content

Commit

Permalink
Fix issue with git grep when no file extensions are specified
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CeleritasCelery committed Sep 12, 2020
1 parent beb3e28 commit 83d383f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dumb-jump.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 83d383f

Please sign in to comment.