Skip to content

Commit

Permalink
Merge pull request #143 from jokem59/master
Browse files Browse the repository at this point in the history
Fix exclude glob patterns
  • Loading branch information
Wilfred authored Oct 28, 2023
2 parents e0eb6e9 + 5d1ab25 commit 960b61f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions deadgrep.el
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,7 @@ to obtain ripgrep results."
((eq (car-safe deadgrep--file-type) 'type)
(push (format "--type=%s" (cdr deadgrep--file-type)) args))
((eq (car-safe deadgrep--file-type) 'glob)
(push (format "--type-add=custom:%s" (cdr deadgrep--file-type)) args)
(push "--type=custom" args))
(push (format "--glob=%s" (cdr deadgrep--file-type)) args))
(t
(error "Unknown file-type: %S" deadgrep--file-type)))

Expand Down
2 changes: 1 addition & 1 deletion test/deadgrep-unit-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ edit mode."
(let ((deadgrep--file-type '(glob . "*.el")))
(should
(equal (deadgrep--arguments "foo" 'words 'ignore '(3 . 2))
'("--no-config" "--color=ansi" "--line-number" "--no-heading" "--no-column" "--with-filename" "--fixed-strings" "--word-regexp" "--ignore-case" "--type-add=custom:*.el" "--type=custom" "--before-context=3" "--after-context=2" "--" "foo" ".")))))
'("--no-config" "--color=ansi" "--line-number" "--no-heading" "--no-column" "--with-filename" "--fixed-strings" "--word-regexp" "--ignore-case" "--glob=*.el" "--before-context=3" "--after-context=2" "--" "foo" ".")))))

(ert-deftest deadgrep--arguments-error-cases ()
(should-error
Expand Down

0 comments on commit 960b61f

Please sign in to comment.