mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-01-19 09:36:47 +02:00
git fetcher: relax absolute URL check of resolveSubmoduleUrl
This matches up the behavior with the internals of libgit2 Fixes #9979
This commit is contained in:
parent
da1e977bf4
commit
1f73de2629
1 changed files with 5 additions and 1 deletions
|
@ -313,7 +313,11 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
|
|||
|
||||
std::string res(buf.ptr);
|
||||
|
||||
if (!hasPrefix(res, "/") && res.find("://") == res.npos)
|
||||
// Git has a default protocol of 'ssh' for URLs without a protocol:
|
||||
// https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_ssh_protocol
|
||||
// This code matches what git_submodule_resolve_url does inside of itself to see if the URL is already absolute.
|
||||
// Inside libgit2 it just checks whether there's any ':' in the URL to default to the ssh:// protocol.
|
||||
if (!hasPrefix(res, "/") && res.find(":") == res.npos)
|
||||
res = parseURL(base + "/" + res).canonicalise().to_string();
|
||||
|
||||
return res;
|
||||
|
|
Loading…
Reference in a new issue