summaryrefslogtreecommitdiff
path: root/clone.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-18 19:36:05 -0600
committerJeff Carr <[email protected]>2024-12-18 19:36:05 -0600
commit934daa5a3b5e936ea384d8fad0659d60b8d313f9 (patch)
tree2e0c2bb8c86f80719d28b85eca0bc24a08a6fde6 /clone.go
parenta97b66e8f23266db6652ec34cc9b1446e4ba65e5 (diff)
maybe works somewhat
Diffstat (limited to 'clone.go')
-rw-r--r--clone.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/clone.go b/clone.go
index 8225c58..63c9fc2 100644
--- a/clone.go
+++ b/clone.go
@@ -126,13 +126,11 @@ func (f *Forge) goClonePop(gopath string) (*gitpb.Repo, error) {
if gopath == "" {
return nil, nil
}
- fullpath := filepath.Join(f.GetGoSrc(), gopath)
- if pb := f.FindAnyPath(fullpath); pb != nil {
- // repo already exists
- return pb, nil
+ newpath, newdir := filepath.Split(gopath)
+ if newdir == "" {
+ // nothing to chop
+ return nil, nil
}
-
- newpath, _ := filepath.Split(gopath)
if repo, _ := f.urlClone(newpath, "https://"+newpath); repo != nil {
return repo, nil
}
@@ -140,7 +138,7 @@ func (f *Forge) goClonePop(gopath string) (*gitpb.Repo, error) {
if repo, err := f.goClonePop(newpath); repo != nil {
return repo, err
}
- return nil, fmt.Errorf("forge.goClonePop() failed %s", gopath)
+ return nil, fmt.Errorf("forge.goClonePop() did not work %s", gopath)
}
// clone a URL directly, also try cloning if 'go-import' is sent