simplify gitlab.

This commit is contained in:
Paul Irish 2015-02-23 16:13:23 -08:00 committed by Johan Hermansson
parent 03bab8edf5
commit 197a681314

View file

@ -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}