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
+1 -2
View File
@@ -120,9 +120,8 @@ hash_from_ref(){
url_to_name(){
local url=$1
local ref=$2
# basename removes the / and .git suffixes
local base
base=$(basename "$url" .git)
base=$(basename "$url" .git | cut -d: -f2)
if [[ $ref =~ ^[a-z0-9]+$ ]]; then
echo "$base-${ref:0:7}"