scm: Fix git clone issue for git+http protocol

`git clone` failed if the URL is specified as git+http.

    git: 'remote-git+http' is not a git command. See 'git --help'.

JIRA: RHELCMP-14340
Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
Haibo Lin 2025-02-13 09:14:25 +08:00 committed by lsedlar
parent fc0de97c5e
commit 1a594e4148

View file

@ -160,6 +160,9 @@ class GitWrapper(ScmBase):
if "://" not in repo:
repo = "file://%s" % repo
if repo.startswith("git+http"):
repo = repo[4:]
git_cmd = ["git"]
if "credential_helper" in self.options:
git_cmd.extend(["-c", "credential.useHttpPath=true"])