From e9bc01172d107a26925bcd680e02da78fd86d367 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 1 Dec 2016 15:42:47 +0000 Subject: [PATCH] git.sh --- etc/profile.d/functions | 1 + etc/profile.d/git.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 20066003..7ca51cf6 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -643,6 +643,7 @@ url2nc() { s,:([a-zAZ]),/$1,; m,^\w+://, or $_="ssh://$_"; @_ = URI::Split::uri_split($_) or next; + $_[1] =~ s/:(.*$)// and $_[2] = $1.$_[2]; } $_=$_[1]; diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index a2d82381..d3f5142d 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -133,7 +133,8 @@ git_conn_check() { logger -t $NAME -s "Can't get url from \`git config --het remote.origin.url\` in `pwd`" return 1 fi - #[ "$1" = "TEST" ] && + + echo "$dest" | grep -qm1 '^[a-z]\+:' || dest="ssh://$dest" dest=$(url2nc "$dest") local ok -- 2.47.3