@@ -194,6 +194,45 @@ setup() {
194
194
}
195
195
196
196
197
+ @test " bitbucket: Bitbucket Server" {
198
+ # https://github.com/paulirish/git-open/issues/77#issuecomment-309044010
199
+ git remote set-url origin
" https://[email protected] /scm/ppp/rrr.git"
200
+ run ../git-open
201
+
202
+ # any of the following are acceptable
203
+ assert_output " https://mybb.domain.com/projects/ppp/repos/rrr" ||
204
+ assert_output " https://mybb.domain.com/projects/ppp/repos/rrr/browse/?at=master" ||
205
+ assert_output " https://mybb.domain.com/projects/ppp/repos/rrr/browse/?at=refs%2Fheads%2Fmaster"
206
+ }
207
+
208
+ @test " bitbucket: Bitbucket Server branch" {
209
+ # https://github.com/paulirish/git-open/issues/80
210
+ git remote set-url origin
" https://[email protected] /scm/ppp/rrr.git"
211
+ git checkout -B " develop"
212
+ run ../git-open
213
+
214
+ # The following query args work with BB Server:
215
+ # at=refs%2Fheads%2Fdevelop, at=develop, at=refs/heads/develop
216
+ # However /src/develop does not (unlike bitbucket.org)
217
+ assert_output " https://mybb.domain.com/projects/ppp/repos/rrr/browse?at=develop" ||
218
+ assert_output " https://mybb.domain.com/projects/ppp/repos/rrr/browse?at=refs%2Fheads%2Fdevelop" ||
219
+ assert_output " https://mybb.domain.com/projects/ppp/repos/rrr/browse?at=refs/heads/develop"
220
+
221
+ refute_output --partial " /src/develop"
222
+ }
223
+
224
+
225
+ @test " bitbucket: Bitbucket Server private user repos" {
226
+ # https://github.com/paulirish/git-open/pull/83#issuecomment-309968538
227
+ git remote set-url origin " https://mybb.domain.com/scm/~first.last/rrr.git"
228
+ git checkout -B " develop"
229
+ run ../git-open
230
+ assert_output " https://mybb.domain.com/projects/~first.last/repos/rrr/browse?at=develop" ||
231
+ assert_output " https://mybb.domain.com/projects/~first.last/repos/rrr/browse?at=refs%2Fheads%2Fdevelop" ||
232
+ assert_output " https://mybb.domain.com/projects/~first.last/repos/rrr/browse?at=refs/heads/develop"
233
+
234
+ }
235
+
197
236
# #
198
237
# # GitLab
199
238
# #
0 commit comments