diff --git a/pkg/loader/githubloader.go b/pkg/loader/gitcloner.go similarity index 100% rename from pkg/loader/githubloader.go rename to pkg/loader/gitcloner.go index c0e5a254e1..ad59b5e8cb 100644 --- a/pkg/loader/githubloader.go +++ b/pkg/loader/gitcloner.go @@ -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() diff --git a/pkg/loader/githubloader_test.go b/pkg/loader/gitcloner_test.go similarity index 100% rename from pkg/loader/githubloader_test.go rename to pkg/loader/gitcloner_test.go