Repository navigation
Keep a submodule-ignored file out when its folder is spelled differently - #34
Merged
Merged
Conversation
On Windows, a request naming vendor/lib.py and VENDOR/key.secret made Git refuse the list with the submodule in its registered spelling. The answer from the submodule was rebuilt with that prefix, so VENDOR/key.secret matched nothing and the file the submodule ignores was sent. Match the answer back to the names as given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows, a review request that names a file inside a submodule in two spellings of the folder, for example
vendor/lib.pyandVENDOR/key.secret, sent the file the submodule's own.gitignoreexcludes.Git refuses the whole
check-ignorelist when one path is in a submodule, and names the submodule as registered (vendor)._ask_gitthen asked the submodule about its files and rebuilt the answer with that prefix, soVENDOR/key.secretcame back asvendor/key.secret, matched no name as given, and the file was allowed into the package. Naming onlyVENDOR/key.secretwas not affected, nor was any non-Windows system.The fix keeps each name inside the submodule with its part below the prefix and maps the submodule's answer back to the names as given.
src/modelquad/execution/file_rules.py, about six lines.Found during an internal verification experiment; reproduced on the current
main(069a678) with real Git:review.packagesentVENDOR/key.secretin that request.No issue was opened for it.
Tests run
python scripts/check.py fastpython scripts/check.py review(130 passed, 2 skipped)test_a_submodule_file_named_in_another_spelling_is_still_ignoredbuilds a real repository with a submodule; it failed before the fix (the ignored file was in the allowed list) and passes now. It is skipped off Windows, where the two spellings are different folders. The existing submodule test now shares its setup helper.tests/test_attached_file_rules.py: 79 passed.Windows version: Windows 11 Pro 10.0.26300
AI assistance
Claude Code (Claude Opus 5.5) found the case in a verification experiment, reproduced it, wrote the fix, the test and the changelog line.
Checklist
git commit -s), as described in CONTRIBUTING.md (DCO 1.1). The maintainer's own commits need none.Not changed here, both fail closed (nothing is sent): with the working folder below the repository root, or a submodule name containing a quote, every named file is withheld as
git_check_failed.🤖 Generated with Claude Code