@@ -177,18 +177,6 @@ setup() {
177177# # GitLab
178178# #
179179
180- @test " gitlab: separate domains" {
181- skip
182- # skipping until test is fixed: see #87
183-
184- # https://github.com/paulirish/git-open/pull/56
185- git remote set-url origin
" [email protected] :namespace/project.git" 186- git config " gitopen.gitlab.domain" " gitlab.example.com"
187- git config " gitopen.gitlab.ssh.domain" " git.example.com"
188- run ../git-open
189- assert_output " https://gitlab.example.com/namespace/project"
190- }
191-
192180@test " gitlab: default ssh origin style" {
193181 # https://github.com/paulirish/git-open/pull/55
194182 git remote set-url origin
" [email protected] :user/repo" @@ -206,32 +194,36 @@ setup() {
206194 refute_output --partial " //user"
207195}
208196
209- @test " gitlab: ssh://git@host:port origin" {
210- skip
211- # skipping until test is fixed: see #87
212-
213- # https://github.com/paulirish/git-open/pull/76
214- # this first set mostly matches the "gitlab: ssh://git@ origin" test
215- git remote set-url origin
" ssh://[email protected] /XXX/YYY.git" 216- git config " gitopen.gitlab.domain" " repo.intranet"
197+ @test " gitlab: separate domains" {
198+ # https://github.com/paulirish/git-open/pull/56
199+ git remote set-url origin
" [email protected] :namespace/project.git" 200+ git config --local --add " open.https://git.example.com.domain" " gitlab.example.com"
217201 run ../git-open
218- assert_output " https://repo.intranet/XXX/YYY"
219- refute_output --partial " ssh://"
220- refute_output --partial " //XXX"
202+ assert_output " https://gitlab.example.com/namespace/project"
203+ }
204+
205+ @test " gitlab: special domain and path" {
206+ git remote set-url origin
" ssh://[email protected] :7000/XXX/YYY.git" 207+ git config --local --add " open.https://git.example.com.domain" " repo.intranet/subpath"
208+ git config --local --add " open.https://git.example.com.protocol" " http"
221209
222- git remote set-url origin
" ssh://[email protected] :7000/XXX/YYY.git" 223- git config " gitopen.gitlab.domain" " repo.intranet"
224- git config " gitopen.gitlab.ssh.port" " 7000"
225210 run ../git-open
226- assert_output " https://repo.intranet/XXX/YYY"
227- refute_output --partial " ssh://"
228- refute_output --partial " //XXX"
211+ assert_output " http://repo.intranet/subpath/XXX/YYY"
212+ refute_output --partial " https://"
229213}
230214
231- # Tests not yet written:
232- # * gitopen.gitlab.port
233- # * gitopen.gitlab.protocol
215+ @test " gitlab: different port" {
216+ # https://github.com/paulirish/git-open/pull/76
217+ git remote set-url origin
" ssh://[email protected] :7000/XXX/YYY.git" 218+ run ../git-open
219+ assert_output " https://git.example.com/XXX/YYY"
220+ refute_output --partial " :7000"
234221
222+ git remote set-url origin " https://git.example.com:7000/XXX/YYY.git"
223+ run ../git-open
224+ assert_output " https://git.example.com/XXX/YYY"
225+ refute_output --partial " :7000"
226+ }
235227
236228teardown () {
237229 cd ..
0 commit comments