@@ -132,7 +132,11 @@ func testSecretFactory(t *testing.T, when spec.G, it spec.S) {
132132 "https://github.com" ,
133133 "http://github.com" ,
134134 "https://github.enterprise:1234" ,
135- "http://github.enterprise:1234" ,
135+ "http://github.enterprise:134" ,
136+ "https://domain.com" ,
137+ "http://domain.com" ,
138+ "github.com" ,
139+ "bitbucket.org" ,
136140 }
137141 for _ , testUrl := range validGitUrls {
138142 factory .GitUrl = testUrl
@@ -147,6 +151,9 @@ func testSecretFactory(t *testing.T, when spec.G, it spec.S) {
147151 invalidGitUrls := []string {
148152 "some-git" ,
149153 "https://some-git.com/test" ,
154+ "https://some-git.com/" ,
155+ "https://domain.com/stash/csm/blabla/project.git" ,
156+ "http://github.enterprise:13444456" ,
150157 }
151158 for _ , testUrl := range invalidGitUrls {
152159 factory .GitUrl = testUrl
@@ -162,6 +169,11 @@ func testSecretFactory(t *testing.T, when spec.G, it spec.S) {
162169 it ("creates a secret when a valid ssh git url is passed" , func () {
163170 validGitSshUrls := []string {
164171 "git@github.com" ,
172+ "user@domain.com" ,
173+ "test@github.com" ,
174+ "domain.com" ,
175+ "ssh://git@github.com:123" ,
176+ "ssh://git@github.com" ,
165177 }
166178 for _ , testUrl := range validGitSshUrls {
167179 factory .GitUrl = testUrl
@@ -181,6 +193,13 @@ func testSecretFactory(t *testing.T, when spec.G, it spec.S) {
181193 "git@github.com:user/repo.git" ,
182194 "git@github.com:buildpacks-community/kpack-cli.git" ,
183195 "ssh://git@ssh.github.com:443/YOUR-USERNAME/YOUR-REPOSITORY.git" ,
196+ "git@github.com/abc.git" ,
197+ "git@github.com:user/repo.git" ,
198+ "ssh://git@example.com/path/to/repo.git" ,
199+ "ssh://user@bitbucket.org/group/my-repo.git" ,
200+ "git@custom-git-server.local:myrepo.git" ,
201+ "git@gitlab.com:username/project.git" ,
202+ "git@github.com:44335678" ,
184203 }
185204 for _ , testUrl := range invalidGitSshUrls {
186205 factory .GitUrl = testUrl
0 commit comments