mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Merge pull request #4039 from zhouhaibing089/handle-dot-git-suffix
api/internal/git: handle .git suffix in repospec
This commit is contained in:
@@ -125,7 +125,7 @@ func parseGitUrl(n string) (
|
|||||||
index := strings.Index(n, gitSuffix)
|
index := strings.Index(n, gitSuffix)
|
||||||
orgRepo = n[0:index]
|
orgRepo = n[0:index]
|
||||||
n = n[index+len(gitSuffix):]
|
n = n[index+len(gitSuffix):]
|
||||||
if n[0] == '/' {
|
if len(n) > 0 && n[0] == '/' {
|
||||||
n = n[1:]
|
n = n[1:]
|
||||||
}
|
}
|
||||||
path, gitRef, gitTimeout, gitSubmodules = peelQuery(n)
|
path, gitRef, gitTimeout, gitSubmodules = peelQuery(n)
|
||||||
|
|||||||
@@ -182,6 +182,12 @@ func TestNewRepoSpecFromUrl_CloneSpecs(t *testing.T) {
|
|||||||
absPath: notCloned.String(),
|
absPath: notCloned.String(),
|
||||||
ref: "",
|
ref: "",
|
||||||
},
|
},
|
||||||
|
"t12": {
|
||||||
|
input: "https://bitbucket.example.com/scm/project/repository.git",
|
||||||
|
cloneSpec: "https://bitbucket.example.com/scm/project/repository.git",
|
||||||
|
absPath: notCloned.String(),
|
||||||
|
ref: "",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for tn, tc := range testcases {
|
for tn, tc := range testcases {
|
||||||
t.Run(tn, func(t *testing.T) {
|
t.Run(tn, func(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user