GitHubJacksonized

fix: preserve literal clone URLs by Byron · Pull Request #2172 · gitpython-developers/GitPython

Repo.clone_from() expanded environment-variable references in caller-supplied
URLs before passing them to git clone. This could expose process environment
values to an untrusted remote and made protocol validation apply to a different
value than Git received.

Polish clone URLs without variable or home expansion on native and Cygwin
Git, then apply unsafe-protocol validation to that exact normalized value.
Preserve the literal URL when normalizing the stored origin after a successful
clone, while retaining the existing Git.polish_url() default for callers
that intentionally normalize local paths. Add regression coverage for
POSIX and Windows variable syntax, Cygwin conversion, stored origins, and
post-normalization protocol validation.

Git baseline: git clone passes URL arguments through literally; t/t5601-clone.sh
covers the accepted URL forms without shell-style environment expansion.

Security: GHSA-rwj8-pgh3-r573.

Co-authored-by: Sebastian Thiel <[email protected]>

Originally published at github.com. Every curse word you see was added by the Samuel L. Jacksonizer, a parody site. Not affiliated with Samuel L. Jackson or github.com.