Rename gitloader to gitcloner.

This commit is contained in:
jregan
2018-11-22 08:41:59 -08:00
parent 064b768176
commit 910eb322e0
2 changed files with 12 additions and 12 deletions

View File

@@ -35,6 +35,18 @@ type gitCloner func(url string) (
// Any error encountered when cloning.
err error)
// isRepoUrl checks if a string is a repo Url
func isRepoUrl(s string) bool {
if strings.HasPrefix(s, "https://") {
return true
}
if strings.HasPrefix(s, "git::") {
return true
}
host := strings.SplitN(s, "/", 2)[0]
return strings.Contains(host, ".com") || strings.Contains(host, ".org")
}
func makeTmpDir() (string, error) {
return ioutil.TempDir("", "kustomize-")
}
@@ -51,18 +63,6 @@ func hashicorpGitCloner(repoUrl string) (
return
}
// isRepoUrl checks if a string is a repo Url
func isRepoUrl(s string) bool {
if strings.HasPrefix(s, "https://") {
return true
}
if strings.HasPrefix(s, "git::") {
return true
}
host := strings.SplitN(s, "/", 2)[0]
return strings.Contains(host, ".com") || strings.Contains(host, ".org")
}
// Checkout clones a github repo with specified commit/tag/branch
func checkout(url, dir string) error {
pwd, err := os.Getwd()