From 0189caeb4b44054b2c3889315203b62279f34784 Mon Sep 17 00:00:00 2001 From: Heechul Ryu Date: Fri, 1 May 2020 09:37:02 +0100 Subject: [PATCH 1/3] Open bitbucket with the right branch replace from `?at` to `/` for `providerBranchRef` --- git-open | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-open b/git-open index b7b55cb..7ecc89b 100755 --- a/git-open +++ b/git-open @@ -187,7 +187,7 @@ fi if [[ "$domain" == 'bitbucket.org' ]]; then # Bitbucket, see https://github.com/paulirish/git-open/issues/80 for why ?at is needed. - providerBranchRef="/src?at=$remote_ref" + providerBranchRef="/src/$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 From c908a50824880bcdc5e7b7b5d18caa25c43fff5b Mon Sep 17 00:00:00 2001 From: Heechul Ryu Date: Fri, 1 May 2020 09:39:05 +0100 Subject: [PATCH 2/3] Delete the comment for issue #80 --- git-open | 1 - 1 file changed, 1 deletion(-) diff --git a/git-open b/git-open index 7ecc89b..1fcc655 100755 --- a/git-open +++ b/git-open @@ -186,7 +186,6 @@ else fi if [[ "$domain" == 'bitbucket.org' ]]; then - # Bitbucket, see https://github.com/paulirish/git-open/issues/80 for why ?at is needed. providerBranchRef="/src/$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 From ca8b2348f26f1c02125fd8b2b4e153486950ba13 Mon Sep 17 00:00:00 2001 From: Dave Wikoff Date: Fri, 21 Aug 2020 15:02:54 -0700 Subject: [PATCH 3/3] Fix bitbucket tests --- test/git-open.bats | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/git-open.bats b/test/git-open.bats index 73ef6bd..3de5e9e 100755 --- a/test/git-open.bats +++ b/test/git-open.bats @@ -360,7 +360,7 @@ setup() { git commit -m a git checkout mytag 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" { @@ -376,7 +376,7 @@ setup() { git checkout -B "devel" run ../git-open 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" { @@ -385,9 +385,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 --partial "https://bitbucket.org/guyzmo/git-repo/src" - # BB appears to be fine with both literal or URL-encoded forward slash - assert_output --partial "?at=bugfix/conftest_fix" + assert_output "https://bitbucket.org/guyzmo/git-repo/src/bugfix/conftest_fix" } @test "bitbucket: ssh:// clone urls" {