Commit e00a65c
Block separate git directories during clone
Repo.clone() and Repo.clone_from() did not reject the clone option that redirects repository metadata to a caller-controlled path (GHSA-8mcc-hrx5-hvxc). Regression coverage exercises both keyword and multi-option input through both public clone APIs.
Add the option to the existing clone denylist, matching Repo.init() and the documented allow_unsafe_options contract. Git itself registers --separate-git-dir in builtin/clone.c and verifies the redirected metadata directory in t/t5601-clone.sh.
Validation: PYTHONPATH=$PWD/gitdb:$PWD/smmap uv run ... pytest -q test/test_clone.py (21 passed, 1 skipped).1 parent 9729ed3 commit e00a65c
2 files changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| 153 | + | |
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| |||
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| 263 | + | |
261 | 264 | | |
262 | 265 | | |
263 | 266 | | |
| |||
270 | 273 | | |
271 | 274 | | |
272 | 275 | | |
| 276 | + | |
273 | 277 | | |
274 | 278 | | |
275 | 279 | | |
| |||
0 commit comments