GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — Block separate git directories during clone by Byron · Pull Request #2210 · gitpython-developers/GitPython Conversation
|
| File | Description |
|---|---|
git/repo/base.py |
Adds --separate-git-dir to the clone unsafe-option denylist. |
git/objects/submodule/base.py |
Ensures submodule cloning can still use separate_git_dir internally while validating caller-provided options. |
test/test_clone.py |
Adds regression cases asserting clone/clone_from reject --separate-git-dir and separate_git_dir by default. |
test/test_submodule.py |
Updates a test to explicitly allow unsafe options when using separate_git_dir, keeping focus on submodule-name validation. |
test/test_clone.py:264
--separate-git-dir, add an abbreviated spelling to this unsafe multi_options list. "--config=protocol.ext.allow=always",
"-c protocol.ext.allow=always",
"-cprotocol.ext.allow=always",
"-vcprotocol.ext.allow=always",
f"--separate-git-dir={tmp_dir / 'git-dir'}",
]
test/test_clone.py:277
separate_git_dir (e.g., separate_git_di) so the clone_from path matches the clone path coverage. {"upload_pack": f"touch {tmp_file}"},
{"u": f"touch {tmp_file}"},
{"config": "protocol.ext.allow=always"},
{"c": "protocol.ext.allow=always"},
{"separate_git_dir": tmp_dir / "git-dir"},
]
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
<!-- agent --> 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 The Python package and Alpine test workflows failed across the submodule suite because GitPython internally supplies --separate-git-dir when creating modern submodule layouts. The new public clone guard correctly rejected that option, but could not distinguish the library-generated path from caller input. Validate caller-provided keyword and multi-options before adding the library-controlled metadata path, then explicitly allow the resulting trusted clone invocation. This preserves rejection of unsafe clone_multi_options while restoring normal submodule creation. Update the one test that intentionally invokes Repo.clone_from() with its own separate git directory to opt in explicitly. Assisted-by: GPT 5.6 Co-authored-by: GPT 5.6 <[email protected]> Assisted-by: GPT 5.6 Co-authored-by: GPT 5.6 <[email protected]>
dd59d25 to
b68afff
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.