mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 11:19:35 +01:00
Simplify fix by disallowing / in front of @ to match scp style
This commit is contained in:
parent
23ba64b277
commit
9b258d2f98
1 changed files with 2 additions and 2 deletions
|
|
@ -77,8 +77,8 @@ std::string fixURIForGit(std::string uri, EvalState & state)
|
|||
/* Detects scp-style uris (e.g. git@github.com:NixOS/nix) and fixes
|
||||
* them by removing the `:` and assuming a scheme of `ssh://`
|
||||
* */
|
||||
static std::regex scp_uri("([^/].*)@(.*):(.*)");
|
||||
if (uri[0] != '/' && std::regex_match(uri, scp_uri) && uri.find("://") == std::string::npos)
|
||||
static std::regex scp_uri("([^/]*)@(.*):(.*)");
|
||||
if (uri[0] != '/' && std::regex_match(uri, scp_uri))
|
||||
return fixURI(std::regex_replace(uri, scp_uri, "$1@$2/$3"), state, "ssh");
|
||||
else
|
||||
return fixURI(uri, state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue