Fix unspported Bitbucket Server URL

Bitbucket server does not support the <username> part in the created URL (<protocol>://<username>@<url>/)
I propose to strip these from the URL before opening.
This commit is contained in:
kwaak 2016-11-16 11:53:18 +01:00 committed by GitHub
parent 70e7399140
commit 4db6778346

View file

@ -84,6 +84,10 @@ elif grep -q "/scm/" <<<$giturl; then
re='(.*)/scm/(.*)/(.*)\.git'
if [[ $giturl =~ $re ]]; then
giturl=${BASH_REMATCH[1]}/projects/${BASH_REMATCH[2]}/repos/${BASH_REMATCH[3]}
giturl=${giturl/http\:\/\/[^\@]*\@/http\:\/\/}
giturl=${giturl/https\:\/\/[^\@]*\@/https\:\/\/}
providerUrlDifference=browse
branch="?at=refs%2Fheads%2F${branch}"
fi