Skip to content

Keep a submodule-ignored file out when its folder is spelled differently - #34

Merged
razbenaharon merged 1 commit into
mainfrom
fix/submodule-path-case
Nov 23, 2026
Merged

razbenaharon merged 1 commit into
mainfrom
fix/submodule-path-case

Conversation

@razbenaharon

Copy link
Copy Markdown
Owner

Summary

On Windows, a review request that names a file inside a submodule in two spellings of the folder, for example vendor/lib.py and VENDOR/key.secret, sent the file the submodule's own .gitignore excludes.

Git refuses the whole check-ignore list when one path is in a submodule, and names the submodule as registered (vendor). _ask_git then asked the submodule about its files and rebuilt the answer with that prefix, so VENDOR/key.secret came back as vendor/key.secret, matched no name as given, and the file was allowed into the package. Naming only VENDOR/key.secret was 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.package sent VENDOR/key.secret in that request.

No issue was opened for it.

Tests run

  • python scripts/check.py fast
  • python scripts/check.py review (130 passed, 2 skipped)
  • New or changed behaviour has tests: test_a_submodule_file_named_in_another_spelling_is_still_ignored builds 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

  • Every commit of mine is signed off (git commit -s), as described in CONTRIBUTING.md (DCO 1.1). The maintainer's own commits need none.
  • The change does not weaken the safety invariants in AGENTS.md. It narrows a gap where an excluded file could be sent.
  • A new host or provider was agreed in an issue first, or this change adds none.
  • Documentation is updated, and describes only what the code does today: CHANGELOG "Unreleased".

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

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>
@razbenaharon
razbenaharon merged commit 4b0949b into main Nov 23, 2026
7 checks passed
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