Repository navigation
Check submodule files below the repository top and with quotes in names - #35
Merged
Merged
Conversation
Git names a submodule from the top of the repository, while the names ModelQuad passes are relative to the project folder; a folder below the top therefore matched no name and every file was withheld. The submodule path is now taken relative to the folder (git rev-parse --show-prefix). The pattern for Git's message stopped at the first quote, so a submodule named with a quote was cut short and every file was withheld. The path in submodule now runs to the end of its line. Both cases failed closed; nothing was sent that should not have been. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_run_git now holds the one Git launch of the ignore check; git_ignored still admits Git with resolve_executable and the repository exclusions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Follow-up to #34. Two cases in the Git ignore check (
execution/file_rules.py,_ask_git) withheld every named file asgit_check_failedwhen one of them was inside a submodule. Both failed closed: nothing was sent that should not have been, but the review could not include any file.app/vendor), while the names ModelQuad passes are relative to the project folder (vendor/...), so no name matched. The submodule path is now taken relative to the folder, fromgit rev-parse --show-prefix. That extra Git call runs only when Git reports a file inside a submodule; if it does not answer, the check still withholds everything.it'swas cut toit. The path in submodule now runs to the end of its line.Git launches moved into one helper,
_run_git, which every Git command of the check uses, with the same environment and options as before. Git is still admitted bygit_ignoredthroughresolve_executablewith the repository exclusions; the launch inventory intests/test_executable_resolution_boundary.pynow names the helper.No issue was opened for these.
Tests run
python scripts/check.py fastpython scripts/check.py review(all pass) andpython scripts/check.py python: 3284 passed, 1 failed, 39 skipped. The failure wastests/test_execution.py::test_the_envelope_scan_is_linear_on_hostile_text[11], a 2-second timing bound in code this change does not touch; all 16 cases of it passed when run alone.test_a_submodule_is_checked_when_the_folder_is_below_the_repository_topandtest_a_submodule_with_a_quote_in_its_name_is_checked, both with real Git and a real submodule. Both failed on main and pass now.tests/test_attached_file_rules.py: 81 passed.Windows version: Windows 11 Pro 10.0.26300
AI assistance
Claude Code (Claude Opus 5.5) reproduced the two cases, wrote the fix, the tests and the changelog line. The cases were first reported by verifier sessions in an internal experiment.
Checklist
git commit -s), as described in CONTRIBUTING.md (DCO 1.1). The maintainer's own commits need none.🤖 Generated with Claude Code