mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 17:41:13 +00:00
Allow file paths that look like usernames
This commit is contained in:
@@ -128,10 +128,6 @@ func TestNewRepoSpecFromUrlErrors(t *testing.T) {
|
||||
"https://git@foo.com/path/to/repo",
|
||||
"url lacks host",
|
||||
},
|
||||
"username unsupported with file": {
|
||||
"file://git@/path/to/repo",
|
||||
"url lacks repoPath",
|
||||
},
|
||||
}
|
||||
|
||||
for name, testCase := range badData {
|
||||
@@ -512,6 +508,19 @@ func TestNewRepoSpecFromUrl_Smoke(t *testing.T) {
|
||||
GitSuffix: ".git",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "username-like filepath with file protocol",
|
||||
input: "file://git@home/path/to/repository.git//path?ref=branch",
|
||||
cloneSpec: "file://git@home/path/to/repository.git",
|
||||
absPath: notCloned.Join("path"),
|
||||
repoSpec: RepoSpec{
|
||||
Host: "file://",
|
||||
RepoPath: "git@home/path/to/repository",
|
||||
KustRootPath: "/path",
|
||||
Ref: "branch",
|
||||
GitSuffix: ".git",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "unsupported protocol after username (invalid and will be rejected by git)",
|
||||
input: "git@scp://github.com/org/repo.git//path",
|
||||
|
||||
Reference in New Issue
Block a user