You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b056f39
Browse filesBrowse the repository at this point in the historyBrowse files
committed
fix(repo): require opt-in for reference repositories when cloning
<!-- agent -->
This change follows the clone safety issue recorded in
https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-j8pf-7m8v-xx38.
Passing unchecked clone keyword arguments can make Git read objects from a
caller-controlled local repository, which is surprising for callers that rely
on GitPython's default unsafe-option restrictions.
Add `--reference` and `--reference-if-able` to `Repo.unsafe_git_clone_options`,
requiring `allow_unsafe_options=True` for these options. The shared clone guard
also rejects abbreviated spellings and options supplied through `multi_options`.
Record the advisory in `doc/source/changes.rst`.
Copilot requested: "Please add regression cases for both `clone()` and
`clone_from()`, covering keyword arguments and `multi_options` (including
abbreviated spellings), and verify that `allow_unsafe_options=True` still permits
valid reference-based clones."
Extend the existing rejection cases and add local reference clones through both
APIs, using keyword arguments and joined or split `multi_options`. The opt-in
cases check the recorded alternate object store and read committed content,
including a reference path containing spaces. Initial repositories are generated
by the existing shell fixture rather than using the source checkout's history.
Co-authored-by: Jeroen <jpab.eemsterboer@gmail.com>
Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Assisted-by: GPT 6.1 Sol
0 commit comments