Fix edge case with invalid repo names

This commit is contained in:
Herman Schaaf
2016-08-05 00:16:46 +08:00
parent 9d9192e295
commit b1ab0b2d52

View File

@@ -77,7 +77,10 @@ func download(path, dest string, firstAttempt bool) (root *vcs.RepoRoot, err err
func Clean(path string) (string, error) {
importPath := trimUsername(trimScheme(path))
root, err := vcs.RepoRootForImportPath(importPath, true)
if root.Root == "" || root.Repo == "" {
if err != nil {
return "", err
}
if root != nil && (root.Root == "" || root.Repo == "") {
return root.Root, errors.New("Empty repo root")
}
return root.Root, err