Repository: sharkdp/fd (language: rust)

Issue:
[BUG] Unrestricted option doesn't work when "~/.config/fd/ignore" is set
### Checks

- [X] I have read the troubleshooting section and still think this is a bug.

### Describe the bug you encountered:

Shell snippet to reproduce:

```
> mkdir test-fd
> cd test-fd
> touch .hi what
> ls -a
.hi  what
> fd -u
.hi
what
> echo '.hi' > ~/.config/fd/ignore
> fd -u # I expect the output to be ".hi\nwhat"
what
> fd --version
fd 8.6.0
```

### Describe what you expected to happen:

That last "fd -u" should have shown ".hi", but it ignored it. I don't expect unrestricted mode to respect the global ignore file...

### What version of `fd` are you using?

8.6.0

### Which operating system / distribution are you on?

```shell
arch linux
```



Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e309e6386..be1efc298 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/src/main.rs b/src/main.rs
index 1a95163f9..001ba5a89 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -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,


Test patch: