fetchgit: support "git@server:repo" URLs

Update the code that extracts the base name from a git repo URL so that
it can deal with URLs like "git@server:repo".
This commit is contained in:
Bjørn Forsman
2017-06-24 14:34:08 +02:00
parent 909fb246fd
commit b8658f629b
2 changed files with 3 additions and 3 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
{stdenv, git, cacert}: let
urlToName = url: rev: let
base = baseNameOf (stdenv.lib.removeSuffix "/" url);
inherit (stdenv.lib) removeSuffix splitString last;
base = last (splitString ":" (baseNameOf (removeSuffix "/" url)));
matched = builtins.match "(.*).git" base;