Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion git-open
Original file line number Diff line number Diff line change
Expand Up @@ -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, gitlab, gitea, etc. use `/commit/...` (singular)
openurl="$openurl/commit/$sha"
fi
elif [[ $remote_ref != "master" ]]; then
# simplify URL for master
openurl="$openurl$providerBranchRef"
Expand Down