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:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user