@@ -177,18 +177,6 @@ setup() {
177
177
# # GitLab
178
178
# #
179
179
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 " git@git.example.com: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
-
192
180
@test " gitlab: default ssh origin style" {
193
181
# https://github.com/paulirish/git-open/pull/55
194
182
git remote set-url origin " git@gitlab.example.com:user/repo"
@@ -206,32 +194,36 @@ setup() {
206
194
refute_output --partial " //user"
207
195
}
208
196
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://git@repo.intranet/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 " git@git.example.com:namespace/project.git"
200
+ git config --local --add " open.https://git.example.com.domain" " gitlab.example.com"
217
201
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://git@git.example.com: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"
221
209
222
- git remote set-url origin " ssh://git@repo.intranet:7000/XXX/YYY.git"
223
- git config " gitopen.gitlab.domain" " repo.intranet"
224
- git config " gitopen.gitlab.ssh.port" " 7000"
225
210
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://"
229
213
}
230
214
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://git@git.example.com:7000/XXX/YYY.git"
218
+ run ../git-open
219
+ assert_output " https://git.example.com/XXX/YYY"
220
+ refute_output --partial " :7000"
234
221
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
+ }
235
227
236
228
teardown () {
237
229
cd ..
0 commit comments