From 7877ac93d3df682196464a66216de4ee715a2441 Mon Sep 17 00:00:00 2001 From: kwaak Date: Fri, 14 Jul 2017 11:41:59 +0200 Subject: [PATCH] Update git-open --- git-open | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/git-open b/git-open index 754ee69..c80e1d4 100755 --- a/git-open +++ b/git-open @@ -85,8 +85,10 @@ elif grep -q "/scm/" <<<$giturl; then if [[ $giturl =~ $re ]]; then giturl=${BASH_REMATCH[1]}/projects/${BASH_REMATCH[2]}/repos/${BASH_REMATCH[3]} - giturl=${giturl/http\:\/\/[^\@]*\@/http\:\/\/} - giturl=${giturl/https\:\/\/[^\@]*\@/https\:\/\/} + # Bitbucket Server can't handle an origin which includes the basicAuth part, so it gets stripped + if [[ $giturl =~ ^http(s?)://([^@]*@)(.*)$ ]] ; then + giturl="http${BASH_REMATCH[1]}://${BASH_REMATCH[3]}" + fi providerUrlDifference=browse branch="?at=refs%2Fheads%2F${branch}"