Merge branch 'pull-165' into master

This commit is contained in:
Dave Wikoff 2020-08-21 15:09:30 -07:00
commit 14fdf5c96e
2 changed files with 4 additions and 7 deletions

View file

@ -186,8 +186,7 @@ else
fi fi
if [[ "$domain" == 'bitbucket.org' ]]; then if [[ "$domain" == 'bitbucket.org' ]]; then
# Bitbucket, see https://github.com/paulirish/git-open/issues/80 for why ?at is needed. providerBranchRef="/src/$remote_ref"
providerBranchRef="/src?at=$remote_ref"
elif [[ "${#pathargs[@]}" -ge 3 && ${pathargs[${#pathargs[@]} - 3]} == 'scm' ]]; then 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 # 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 # Anything before the 'scm' is part of the server's root context

View file

@ -360,7 +360,7 @@ setup() {
git commit -m a git commit -m a
git checkout mytag git checkout mytag
run ../git-open run ../git-open
assert_output "https://bitbucket.org/paulirish/crbug-extension/src?at=mytag" assert_output "https://bitbucket.org/paulirish/crbug-extension/src/mytag"
} }
@test "bitbucket: non-origin remote" { @test "bitbucket: non-origin remote" {
@ -376,7 +376,7 @@ setup() {
git checkout -B "devel" git checkout -B "devel"
run ../git-open run ../git-open
refute_output --partial "//kisom" refute_output --partial "//kisom"
assert_output "https://bitbucket.org/kisom/consbri/src?at=devel" assert_output "https://bitbucket.org/kisom/consbri/src/devel"
} }
@test "bitbucket: open source view with a slash/branch" { @test "bitbucket: open source view with a slash/branch" {
@ -385,9 +385,7 @@ setup() {
git remote set-url origin "https://bitbucket.org/guyzmo/git-repo.git" git remote set-url origin "https://bitbucket.org/guyzmo/git-repo.git"
git checkout -B "bugfix/conftest_fix" git checkout -B "bugfix/conftest_fix"
run ../git-open run ../git-open
assert_output --partial "https://bitbucket.org/guyzmo/git-repo/src" assert_output "https://bitbucket.org/guyzmo/git-repo/src/bugfix/conftest_fix"
# BB appears to be fine with both literal or URL-encoded forward slash
assert_output --partial "?at=bugfix/conftest_fix"
} }
@test "bitbucket: ssh:// clone urls" { @test "bitbucket: ssh:// clone urls" {