mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-29 09:06:15 +02:00
Merge pull request #9897 from bryango/fix-submodule-subdir
libutil/url: fix git+file:./ parse error
This commit is contained in:
commit
eb0d46fab6
1 changed files with 9 additions and 9 deletions
|
@ -171,16 +171,16 @@ std::string fixGitURL(const std::string & url)
|
||||||
std::regex scpRegex("([^/]*)@(.*):(.*)");
|
std::regex scpRegex("([^/]*)@(.*):(.*)");
|
||||||
if (!hasPrefix(url, "/") && std::regex_match(url, scpRegex))
|
if (!hasPrefix(url, "/") && std::regex_match(url, scpRegex))
|
||||||
return std::regex_replace(url, scpRegex, "ssh://$1@$2/$3");
|
return std::regex_replace(url, scpRegex, "ssh://$1@$2/$3");
|
||||||
else {
|
if (hasPrefix(url, "file:"))
|
||||||
if (url.find("://") == std::string::npos) {
|
return url;
|
||||||
return (ParsedURL {
|
if (url.find("://") == std::string::npos) {
|
||||||
.scheme = "file",
|
return (ParsedURL {
|
||||||
.authority = "",
|
.scheme = "file",
|
||||||
.path = url
|
.authority = "",
|
||||||
}).to_string();
|
.path = url
|
||||||
} else
|
}).to_string();
|
||||||
return url;
|
|
||||||
}
|
}
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.rfc-editor.org/rfc/rfc3986#section-3.1
|
// https://www.rfc-editor.org/rfc/rfc3986#section-3.1
|
||||||
|
|
Loading…
Reference in a new issue