1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Generalize recognized git url schemas (#13925)

Use `parseUrlScheme` instead of manually parsing `url.scheme`.
This commit is contained in:
Tom Westerhout 2025-09-07 15:22:20 +02:00 committed by GitHub
parent df9b3bfba8
commit dbc235cc62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -163,8 +163,8 @@ struct GitInputScheme : InputScheme
{ {
std::optional<Input> inputFromURL(const Settings & settings, const ParsedURL & url, bool requireTree) const override std::optional<Input> inputFromURL(const Settings & settings, const ParsedURL & url, bool requireTree) const override
{ {
if (url.scheme != "git" && url.scheme != "git+http" && url.scheme != "git+https" && url.scheme != "git+ssh" auto parsedScheme = parseUrlScheme(url.scheme);
&& url.scheme != "git+file") if (parsedScheme.application != "git")
return {}; return {};
auto url2(url); auto url2(url);