There was a problem hiding this comment.
Fixes relative [include] path = ... handling when the root config file is provided as a relative path (regression for #2103), by normalizing config file paths for both include-cycle detection and relative-include resolution.
Changes:
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| git/config.py | Normalizes config paths for seen and uses an absolute source path to resolve relative include paths without asserting the caller provided an absolute root path. |
| test/test_config.py | Adds a regression test ensuring relative root config paths correctly resolve relative includes and avoid include-cycle failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was a problem hiding this comment.
It looks like Windows has problems, but that might point to some logic error.
There should also be a test that actually validates that cycle-detection, by putting one of the include files in a directory.
Sorry, something went wrong.
|
@Byron Added the nested-directory include cycle coverage in 483f0c6: the relative root config now includes subdir/b, and that nested file includes ../a. Validation passed with test/test_config.py, Ruff, mypy on git/config.py, and git diff --check. |
Sorry, something went wrong.
| fpa = osp.join(rw_dir, "a") | ||
| nested_dir = osp.join(rw_dir, "subdir") | ||
| os.makedirs(nested_dir) | ||
| fpb = osp.join(nested_dir, "b") |
There was a problem hiding this comment.
One of the included files need to be in a subdirectory, and both need to be named "a" so the relative name is the same for an actual cycle check.
Sorry, something went wrong.
There was a problem hiding this comment.
Windows still fails, also the cycle check isn't addressed. It seems like this is a bot account and I don't want to spend more time here.
Will close if the PR isn't green and has its issues addressed next time it comes out of draft.
Sorry, something went wrong.
Fixes #2103
Summary
Testing