mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
Better handling of SSH protocol for Bitbucket
This commit is contained in:
parent
421888c04a
commit
f79712de8b
6
git-open
6
git-open
|
|
@ -31,9 +31,6 @@ if [ -z "$giturl" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Convert ssh:// link to a https:// one
|
||||
giturl=$( echo $giturl | sed s_'ssh://git@'_'https://'_ )
|
||||
|
||||
# get current branch
|
||||
if [ -z "$2" ]; then
|
||||
branch=$(git symbolic-ref -q --short HEAD)
|
||||
|
|
@ -63,6 +60,9 @@ elif grep -q github <<<$giturl; then
|
|||
# bitbucket
|
||||
elif grep -q bitbucket <<<$giturl; then
|
||||
giturl=${giturl/git\@bitbucket\.org\:/https://bitbucket.org/}
|
||||
# handle SSH protocol (links like ssh://git@github.com/user/repo)
|
||||
giturl=${giturl/#ssh\:\/\/git\@bitbucket\.org\//https://bitbucket.org/}
|
||||
|
||||
rev="$(git rev-parse HEAD)"
|
||||
git_pwd="$(git rev-parse --show-prefix)"
|
||||
providerUrlDifference="src/${rev}/${git_pwd}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue