Fix git+ssh:// links inside installed packages not being converted properly to https authenticated links

This commit is contained in:
allegroai 2023-03-28 14:35:51 +03:00
parent 787c7d88bb
commit afffa83063

View File

@ -94,12 +94,13 @@ class ExternalRequirements(SimpleSubstitution):
vcs_url = vcs_url[::-1].replace(fragment[::-1], '', 1)[::-1]
# remove ssh:// or git:// prefix for git detection and credentials
scheme = ''
full_vcs_url = vcs_url
if vcs_url and (vcs_url.startswith('ssh://') or vcs_url.startswith('git://')):
scheme = 'ssh://' # notice git:// is actually ssh://
vcs_url = vcs_url[6:]
from ..repo import Git
vcs = Git(session=session, url=vcs_url, location=None, revision=None)
vcs = Git(session=session, url=full_vcs_url, location=None, revision=None)
vcs._set_ssh_url()
new_req_line = 'git+{}{}{}'.format(
'' if scheme and '://' in vcs.url else scheme,