Delete some dead code and fix nits.

This commit is contained in:
jregan
2019-01-29 11:59:00 -08:00
parent 93515517b8
commit 35daae1715
10 changed files with 30 additions and 263 deletions

View File

@@ -72,19 +72,6 @@ func (x *RepoSpec) Cleaner(fSys fs.FileSystem) func() error {
return func() error { return fSys.RemoveAll(x.cloneDir.String()) }
}
// IsRepoUrl checks if a string is likely a github repo Url.
func IsRepoUrl(arg string) bool {
arg = strings.ToLower(arg)
return !filepath.IsAbs(arg) &&
(strings.HasPrefix(arg, "git::") ||
strings.HasPrefix(arg, "gh:") ||
strings.HasPrefix(arg, "ssh:") ||
strings.HasPrefix(arg, "github.com") ||
strings.HasPrefix(arg, "git@") ||
strings.Index(arg, "github.com/") > -1 ||
isAzureHost(arg) || isAWSHost(arg))
}
// From strings like git@github.com:someOrg/someRepo.git or
// https://github.com/someOrg/someRepo?ref=someHash, extract
// the parts.
@@ -104,11 +91,6 @@ func NewRepoSpecFromUrl(n string) (*RepoSpec, error) {
path: path, ref: gitRef}, nil
}
func NewRepoSpec(
raw string, cloneDir fs.ConfirmedDir, path string) *RepoSpec {
return &RepoSpec{raw: raw, cloneDir: cloneDir, path: path}
}
const (
refQuery = "?ref="
gitSuffix = ".git"