diff --git a/CHANGELOG.md b/CHANGELOG.md index a46c3a97b..ec707da8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Find out more about isort's release policy [here](https://pycqa.github.io/isort/ ### 5.10.0 TBD - Implemented #1796: Switch to `tomli` for pyproject.toml configuration loader. - Fixed #1801: CLI bug (--exend-skip-glob, overrides instead of extending). + - Fixed #1802: respect PATH customization in nested calls to git. #### Potentially breaking changes: - Fixed #1785: `_ast` module incorrectly excluded from stdlib definition. diff --git a/isort/settings.py b/isort/settings.py index 67c4b7932..3752b6336 100644 --- a/isort/settings.py +++ b/isort/settings.py @@ -538,7 +538,7 @@ def is_supported_filetype(self, file_name: str) -> bool: return bool(_SHEBANG_RE.match(line)) def _check_folder_gitignore(self, folder: str) -> Optional[Path]: - env = {"LANG": "C.UTF-8"} + env = {**os.environ, "LANG": "C.UTF-8"} try: topfolder_result = subprocess.check_output( # nosec # skipcq: PYL-W1510 ["git", "-C", folder, "rev-parse", "--show-toplevel"], encoding="utf-8", env=env