Skip to content

Stop configuration discovery at Git worktree boundaries - #2654

Open
vzer200 wants to merge 1 commit into
PyCQA:mainfrom
vzer200:issue/2068
Open

Stop configuration discovery at Git worktree boundaries#2654
vzer200 wants to merge 1 commit into
PyCQA:mainfrom
vzer200:issue/2068

Conversation

@vzer200

@vzer200 vzer200 commented Sep 8, 2026

Copy link
Copy Markdown

When a Git worktree has no local isort configuration, its .git file is ignored during configuration discovery. An outer .isort.cfg can then be inherited, changing the source paths and classifying a local module as third party. Stop discovery at .git files as well as directories, while retaining local config precedence and the existing Mercurial boundary behavior.

Addresses the reproduced outer-configuration case of #2068. This does not establish the cause of every worktree classification problem in that report.

Validation on Windows with Python 3.12:

  • Eight regression/control cases: two fail against unchanged main; all pass with the fix. Complete unit suite: 629 passed, 5 skipped, with 99.34% branch-enabled coverage; independently rerun with the same result.
  • Actual linked/orphan worktrees and ordinary repositories checked through both the API and CLI. Independent checks also cover separate Git metadata directories, local/empty/unrelated configuration, explicit external settings files and runtime overrides.
  • Full Ruff check/format, flake8 and Linux-platform mypy pass. Changed-file isort and Bandit pass. Full checks retain the same baseline findings: Windows os.mkfifo typing, the existing CRLF formatting fixture, and Bandit's assertion finding in parse.py:407.

Other Python/OS runtimes, mypyc builds and the network-cloning integration suite were not run.

AI disclosure: developed and independently reviewed by Codex agents on behalf of vzer200; no human line-by-line review is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant