Skip to content

Commit

Permalink
Rename gitloader to gitcloner.
Browse files Browse the repository at this point in the history
  • Loading branch information
monopole committed Nov 22, 2018
1 parent 064b768 commit 910eb32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pkg/loader/githubloader.go → pkg/loader/gitcloner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-")
}
Expand All @@ -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()
Expand Down
File renamed without changes.

0 comments on commit 910eb32

Please sign in to comment.