mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
Merge branch 'master' into rewrite
This commit is contained in:
commit
75ced59719
|
|
@ -34,7 +34,8 @@
|
|||
"lint:editorconfig": "eclint check git-open* readme* .travis.yml",
|
||||
"lint:package": "pjv --recommendations --warnings",
|
||||
"lint:readme": "node ./node_modules/markdownlint/lib/markdownlint.js --config markdownlint.json README.md",
|
||||
"test": "npm run lint:package && npm run lint:readme && npm run lint:editorconfig",
|
||||
"test": "npm run unit && npm run lint:package && npm run lint:readme && npm run lint:editorconfig",
|
||||
"unit": "bats test/",
|
||||
"watch": "find . -maxdepth 2 -iname '*bats' -o -iname 'git-open' | entr bats test/"
|
||||
},
|
||||
"dependencies": {},
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ setup() {
|
|||
assert_output "https://gitlab.example.com/user/repo"
|
||||
}
|
||||
|
||||
@test "gitlab: ssh:// origin style" {
|
||||
@test "gitlab: ssh://git@ origin" {
|
||||
# https://github.com/paulirish/git-open/pull/51
|
||||
git remote set-url origin "ssh://git@gitlab.domain.com/user/repo"
|
||||
git config "gitopen.gitlab.domain" "gitlab.domain.com"
|
||||
|
|
@ -201,6 +201,24 @@ setup() {
|
|||
refute_output --partial "//"
|
||||
}
|
||||
|
||||
@test "gitlab: ssh://git@host:port origin" {
|
||||
# https://github.com/paulirish/git-open/pull/76
|
||||
# this first set mostly matches the "gitlab: ssh://git@ origin" test
|
||||
git remote set-url origin "ssh://git@repo.intranet/XXX/YYY.git"
|
||||
git config "gitopen.gitlab.domain" "repo.intranet"
|
||||
run ../git-open
|
||||
assert_output "https://repo.intranet/XXX/YYY/"
|
||||
refute_output --partial "ssh://"
|
||||
refute_output --partial "//XXX"
|
||||
|
||||
git remote set-url origin "ssh://git@repo.intranet: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://"
|
||||
refute_output --partial "//XXX"
|
||||
}
|
||||
|
||||
# Tests not yet written:
|
||||
# * gitopen.gitlab.port
|
||||
|
|
|
|||
Loading…
Reference in a new issue