This commit is contained in:
Ram 2024-02-21 11:26:13 -08:00 committed by GitHub
commit 3a536f9477
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -245,7 +245,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, gitlab, gitea, etc. use `/commit/...` (singular)
openurl="$openurl/commit/$sha"
fi
elif [[ $remote_ref != "master" ]]; then
# simplify URL for master
openurl="$openurl$providerBranchRef"