```python
Check if file is git-ignored. Supports nested .gitignore files.

Args:
filename (`str` or `Path`):
The filename to check.

Returns:
`bool`: `True` if the file passed is ignored by `git`, `False`
otherwise.
```