Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open -c URL fixed for bitbucket #169

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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

paulirish marked this conversation as resolved.
Show resolved Hide resolved
openurl="$openurl/commit/$sha"
fi
elif [[ $remote_ref != "master" ]]; then
# simplify URL for master
openurl="$openurl$providerBranchRef"
Expand Down