-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for gitlab: ssh:https://git@host:port origin (#82)
- Loading branch information
Showing
1 changed file
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,7 @@ setup() { | |
assert_output "https://gitlab.example.com/user/repo/" | ||
} | ||
|
||
@test "gitlab: ssh:https:// origin style" { | ||
@test "gitlab: ssh:https://git@ origin" { | ||
# https://github.com/paulirish/git-open/pull/51 | ||
git remote set-url origin "ssh:https://[email protected]/user/repo" | ||
git config "gitopen.gitlab.domain" "gitlab.domain.com" | ||
|
@@ -186,6 +186,24 @@ setup() { | |
refute_output --partial "//" | ||
} | ||
|
||
@test "gitlab: ssh:https://git@host:port origin" { | ||
# https://github.com/paulirish/git-open/pull/76 | ||
# this first set mostly matches the "gitlab: ssh:https://git@ origin" test | ||
git remote set-url origin "ssh:https://[email protected]/XXX/YYY.git" | ||
git config "gitopen.gitlab.domain" "repo.intranet" | ||
run ../git-open | ||
assert_output "https://repo.intranet/XXX/YYY/" | ||
refute_output --partial "ssh:https://" | ||
refute_output --partial "//XXX" | ||
|
||
git remote set-url origin "ssh:https://[email protected]:7000/XXX/YYY.git" | ||
git config "gitopen.gitlab.domain" "repo.intranet" | ||
git config "gitopen.gitlab.ssh.port" "7000" | ||
run ../git-open | ||
assert_output "https://repo.intranet/XXX/YYY/" | ||
refute_output --partial "ssh:https://" | ||
refute_output --partial "//XXX" | ||
} | ||
|
||
# Tests not yet written: | ||
# * gitopen.gitlab.port | ||
|