mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
simplify gitlab.
This commit is contained in:
parent
cba1cebfe4
commit
d8bfad3840
17
git-open
17
git-open
|
|
@ -43,11 +43,11 @@ else
|
|||
fi
|
||||
|
||||
# URL normalization
|
||||
# Github support
|
||||
# Github
|
||||
if grep -q github <<<$giturl; then
|
||||
giturl=${giturl/git\@github\.com\:/https://github.com/}
|
||||
providerUrlDifference=tree
|
||||
# bitbucket support
|
||||
# bitbucket
|
||||
elif grep -q bitbucket <<<$giturl; then
|
||||
giturl=${giturl/git\@bitbucket\.org\:/https://bitbucket.org/}
|
||||
providerUrlDifference=branch
|
||||
|
|
@ -64,18 +64,17 @@ giturl=${giturl%\.git}
|
|||
branch="?at=refs%2Fheads%2F${branch}"
|
||||
fi
|
||||
else
|
||||
# custom gitlab
|
||||
gitlab_domain=$(git config --get gitopen.gitlab.domain)
|
||||
if [ ! -z "$gitlab_domain" ]; then
|
||||
if grep -q $gitlab_domain <<<$giturl; then
|
||||
giturl=${giturl/git\@${gitlab_domain}:/https://${gitlab_domain}/}
|
||||
|
||||
gitlab_urldifference=$(git config --get gitopen.gitlab.urldifference)
|
||||
if [ -z "$gitlab_urldifference" ]; then
|
||||
providerUrlDifference=tree
|
||||
else
|
||||
providerUrlDifference=$gitlab_urldifference
|
||||
fi
|
||||
providerUrlDifference=tree
|
||||
fi
|
||||
# hosted gitlab
|
||||
elif grep -q gitlab <<<$giturl; then
|
||||
giturl=${giturl/git\@gitlab\.com\:/https://gitlab.com/}
|
||||
providerUrlDifference=tree
|
||||
fi
|
||||
fi
|
||||
giturl=${giturl%\.git}
|
||||
|
|
|
|||
Loading…
Reference in a new issue