| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
<!-- agent --> Direct recursive updates with keep_going could swallow an invalid-name validation error and then access mrepo before assignment. Reproduce that path and initialize mrepo before validation so recursion is safely skipped. Git baseline: submodule.c at 883a47ef6496c96a5d6132ed8c87fcd44ebf8d1a validates submodule paths before operating on them. Assisted-by: GPT 5.6 Co-authored-by: GPT 5.6 <codex@openai.com>
<!-- agent --> _module_abspath only validated names when Git used separate gitfile submodule directories, so legacy Git behavior could accept the same invalid name. Validate before selecting the Git-version-dependent path branch and cover the legacy branch explicitly. Git baseline: submodule.c at 883a47ef6496c96a5d6132ed8c87fcd44ebf8d1a validates submodule paths before filesystem operations. Assisted-by: GPT 5.6 Co-authored-by: GPT 5.6 <codex@openai.com>
There was a problem hiding this comment.
Fixes a crash path in recursive submodule updates when invalid submodule names are encountered with keep_going=True, and makes submodule-name validation consistent across Git-version-dependent code paths.
Changes:
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/test_submodule.py | Adds regression coverage for invalid-name handling across both module-path branches and direct recursive updates with keep_going=True. |
| git/objects/submodule/base.py | Ensures name validation is applied consistently and prevents mrepo from being used before assignment when errors are swallowed. |
| .basedpyright/baseline.json | Removes a now-fixed “possibly unbound variable” baseline entry consistent with the mrepo initialization change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by Codex GPT-5.
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Reported issue
When an invalidly named submodule is updated directly with both recursive=True and keep_going=True, this validation error is swallowed, but execution then reaches the recursion block and reads mrepo before it has been assigned, raising UnboundLocalError instead of honoring keep_going. Fresh evidence in this revision is that the validation was moved inside the try without initializing mrepo on the non-dry-run path; initialize it before the try or skip recursion after the handled failure.
And in a separate stg commit: _module_abspath() only validates name when _need_gitfile_submodules() is true. This makes behavior depend on the installed git version and can allow invalid names to pass through this helper silently on older git versions (even though other code paths now expect invalid names to raise consistently). Consider validating name unconditionally at the start of the method and then using the validated value in the gitfile-submodules branch.
Changes
Git baseline
Git submodule.c at 883a47ef6496c96a5d6132ed8c87fcd44ebf8d1a validates submodule paths before filesystem operations.
Validation