From 39f8288b846f6ea95d837a38aa8e1bf71acecaf3 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Wed, 22 Nov 2023 21:11:12 +0000 Subject: [PATCH] updated git.sh --- lib/git.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/git.sh b/lib/git.sh index 739f644f..89387cd9 100755 --- a/lib/git.sh +++ b/lib/git.sh @@ -203,10 +203,14 @@ git_to_azure_url(){ azure_to_git_url(){ local url="$1" - #url="${url/:v3\//:}" - url="${url/\/_git\//\/}" - # XXX: strip the middle component out from git@ssh.dev.azure.com:v3/harisekhon/GitHub/DevOps-Bash-tools - url="$(perl -pe 's/v3\/([\/:][^\/:]+)(\/[^\/]+)(\/[^\/]+)$/$1$3/' <<< "$url")" + url="${url/:v3\//:}" + #url="${url/\/_git\//\/}" + # XXX: strip the middle component out from Azure URLs that aren't found in other major Git providers like GitHub / GitLab / Bitbucket: + # + # git@ssh.dev.azure.com:v3/harisekhon/GitHub/DevOps-Bash-tools + # https://dev.azure.com/harisekhon/GitHub/_git/DevOps-Bash-tools + # + url="$(perl -pe 's/([\/:][^\/:]+)\/[^\/]+\/_git(\/[^\/]+)$/$1$2/' <<< "$url")" echo "$url" }