Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions git-open
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ else
fi

if [[ "$domain" == 'bitbucket.org' ]]; then
# Branches have a dedicated view; tags and detached commits use the source view
providerBranchRef="/src/$remote_ref"
[[ -n "${upstream_branch:-$branch}" ]] && providerBranchRef="/branch/$remote_ref"
elif [[ "${#pathargs[@]}" -ge 3 && ${pathargs[${#pathargs[@]} - 3]} == 'scm' ]]; then
# Bitbucket server always has /scm/ as the third to last segment in the url path, e.g. /scm/ppp/test-repo.git
# Anything before the 'scm' is part of the server's root context
Expand Down
4 changes: 2 additions & 2 deletions test/git-open.bats
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ setup() {
git checkout -B "devel"
run ../git-open
refute_output --partial "//kisom"
assert_output "https://bitbucket.org/kisom/consbri/src/devel"
assert_output "https://bitbucket.org/kisom/consbri/branch/devel"
}

@test "bitbucket: open source view with a slash/branch" {
Expand All @@ -407,7 +407,7 @@ setup() {
git remote set-url origin "https://bitbucket.org/guyzmo/git-repo.git"
git checkout -B "bugfix/conftest_fix"
run ../git-open
assert_output "https://bitbucket.org/guyzmo/git-repo/src/bugfix/conftest_fix"
assert_output "https://bitbucket.org/guyzmo/git-repo/branch/bugfix/conftest_fix"
}

@test "bitbucket: ssh:// clone urls" {
Expand Down