Commit e1d07cc
Validate submodule names before creating module paths
Submodule names read from .gitmodules can become the separate Git directory path. Reject empty names, absolute or drive-qualified names, and parent components with either path separator at the shared path-construction boundary.
Add a local-repository regression test that demonstrates initialization cannot create a module repository outside the clone. This follows Git commit 0383bbb901 (submodule-config: verify submodule names as paths) while also accounting for os.path.join absolute-path semantics.
Advisory: GHSA-hmq2-w58f-27jc
Validation:
- pytest -q test/test_submodule.py (39 passed, 1 skipped, 1 xfailed)
- ruff check and format --check on changed files
- mypy git/objects/submodule/base.py1 parent 6e61b1d commit e1d07cc
2 files changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
308 | 316 | | |
309 | 317 | | |
310 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
925 | 925 | | |
926 | 926 | | |
927 | 927 | | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
928 | 964 | | |
929 | 965 | | |
930 | 966 | | |
| |||
0 commit comments