Skip to content
Open
Changes from 2 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 and gitlab use `/commit/...` (singular)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested manually only on these 3 services

openurl="$openurl/commit/$sha"
fi
elif [[ $remote_ref != "master" ]]; then
# simplify URL for master
openurl="$openurl$providerBranchRef"
Expand Down