summaryrefslogtreecommitdiff
path: root/repo.new.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-07 16:50:26 -0600
committerJeff Carr <[email protected]>2024-12-07 16:50:26 -0600
commitcb04f3585c1abe95f6bddfa282e829896c2bb19a (patch)
tree782b14c818e267d23daeb797975777f12279a0af /repo.new.go
parent945ae6329b7e4e46e409027984253e358ee87260 (diff)
debugging switching go/src dirsv0.0.27
Diffstat (limited to 'repo.new.go')
-rw-r--r--repo.new.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/repo.new.go b/repo.new.go
index 9404d7b..9d0f7ba 100644
--- a/repo.new.go
+++ b/repo.new.go
@@ -19,7 +19,7 @@ func (all *Repos) NewGoPath(basepath string, gopath string, url string) (*Repo,
}
if r := all.FindByGoPath(gopath); r != nil {
// already had this gopath
- return nil, errors.New("duplicate gopath " + gopath)
+ return r, errors.New("gitpb.NewGoPath() duplicate gopath " + gopath)
}
log.Info("gitpb.NewGoPath() Attempting to add new path", basepath, gopath)
@@ -58,7 +58,11 @@ func (all *Repos) NewGoPath(basepath string, gopath string, url string) (*Repo,
// worked
return &newr, nil
}
- return nil, errors.New("repo already exists: " + gopath)
+ if r := all.FindByGoPath(gopath); r != nil {
+ // already had this gopath
+ return r, errors.New("gitpb.NewGoPath() AppendUnique() failed but Find() worked" + gopath)
+ }
+ return nil, errors.New("repo gitpb.NewGoPath() should never have gotten here " + gopath)
}
func (repo *Repo) SetDevelBranchName(bname string) {