libgit2 / libgit2sharp

Git + .NET = ❤
http://libgit2.github.com
MIT License
3.13k stars 879 forks source link

RecurseSubmodulesException: unsupported URL protocol in git_submodule_update #1990

Closed agaertner closed 1 year ago

agaertner commented 1 year ago

Reproduction steps

Actual behavior

Probably related: https://github.com/libgit2/libgit2sharp/issues/1115 Supposidely fixed with https://github.com/libgit2/libgit2/pull/3500

The current workaround is to rewrite the path in .gitmodules to a relative one (as in the PR from 2015) with a leading "../". Eg.

[submodule "submodules/some-repo"]
    path = submodules/some-repo
    url = ../Some-Repo.git

However, this works only if the repo of the submodule belongs to the same user as the main repo.

EDIT: Log:

EXCEPTION in Job 'DownloadRepoJob' @ 9/27/2022 3:51:44 PM LibGit2Sharp.RecurseSubmodulesException: The top level repository was cloned, but there was an error cloning its submodules.
 ---> LibGit2Sharp.LibGit2SharpException: unsupported URL protocol
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_submodule_update(SubmoduleHandle submodule, Boolean init, GitSubmoduleUpdateOptions& options)
   at LibGit2Sharp.SubmoduleCollection.Update(String name, SubmoduleUpdateOptions options)
   at LibGit2Sharp.Repository.RecursivelyCloneSubmodules(CloneOptions options, String repoPath, Int32 recursionDepth)
   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
   --- End of inner exception stack trace ---
   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
agaertner commented 1 year ago

Using HTTPS in .gitmodules rather than SSH worked.