mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
bitbucket uses /commits (plural), github and gitlab use /commit (singular)
This commit is contained in:
parent
3e8c908dcd
commit
ec5b93eb53
9
git-open
9
git-open
|
|
@ -240,7 +240,14 @@ openurl="$protocol://$domain/$urlpath"
|
|||
|
||||
if (( is_commit )); then
|
||||
sha=$(git rev-parse HEAD)
|
||||
openurl="$openurl/commit/$sha"
|
||||
# commits path can be different for the domain
|
||||
if [[ "$domain" == 'bitbucket.org' ]]; then
|
||||
# bitbucket uses `/commits/...` (plural)
|
||||
openurl="$openurl/commits/$sha"
|
||||
else
|
||||
# github and gitlab use `/commit/...` (singular)
|
||||
openurl="$openurl/commit/$sha"
|
||||
fi
|
||||
elif [[ $remote_ref != "master" ]]; then
|
||||
# simplify URL for master
|
||||
openurl="$openurl$providerBranchRef"
|
||||
|
|
|
|||
Loading…
Reference in a new issue