From 4db67783468da7f4d2734e496a4b2aaccbe221f5 Mon Sep 17 00:00:00 2001 From: kwaak Date: Wed, 16 Nov 2016 11:53:18 +0100 Subject: [PATCH] Fix unspported Bitbucket Server URL Bitbucket server does not support the part in the created URL (://@/) I propose to strip these from the URL before opening. --- git-open | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git-open b/git-open index 3fb6609..754ee69 100755 --- a/git-open +++ b/git-open @@ -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