Fix logic for when to read global ignore file

Fixes #1209
This commit is contained in:
Thayne McCombs 2022-12-17 00:04:41 -07:00
parent addf00cb16
commit 27013537c9
2 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,10 @@
## Bugfixes
- Fix logic for when to use global ignore file. There was a bug where the only case where the
global ignore file wasn't processed was if `--no-ignore` was passed, but neither `--unrestricted`
nor `--no-global-ignore-file` is passed. See #1209
## Changes
## Other

View File

@ -240,7 +240,9 @@ fn construct_config(mut opts: Opts, pattern_regexps: &[String]) -> Result<Config
read_fdignore: !(opts.no_ignore || opts.rg_alias_ignore()),
read_vcsignore: !(opts.no_ignore || opts.rg_alias_ignore() || opts.no_ignore_vcs),
read_parent_ignore: !opts.no_ignore_parent,
read_global_ignore: !opts.no_ignore || opts.rg_alias_ignore() || opts.no_global_ignore_file,
read_global_ignore: !(opts.no_ignore
|| opts.rg_alias_ignore()
|| opts.no_global_ignore_file),
follow_links: opts.follow,
one_file_system: opts.one_file_system,
null_separator: opts.null_separator,