fix Find(gopath0

This commit is contained in:
Jeff Carr 2024-12-17 13:12:52 -06:00
parent 62ad7e676c
commit 5434341272
2 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ func cleanGoDepsCheckOk(check *gitpb.Repo) error {
all := check.GoDeps.SortByGoPath() all := check.GoDeps.SortByGoPath()
for all.Scan() { for all.Scan() {
depRepo := all.Next() depRepo := all.Next()
found := forge.Repos.FindByFullPath(depRepo.GetGoPath()) found := forge.FindByGoPath(depRepo.GetGoPath())
if found == nil { if found == nil {
if forge.CheckOverride(depRepo.GetGoPath()) { if forge.CheckOverride(depRepo.GetGoPath()) {
// skip this gopath because it's probably broken forever // skip this gopath because it's probably broken forever
@ -35,7 +35,7 @@ func cleanGoDepsCheckOk(check *gitpb.Repo) error {
} }
// log.Info("found dep", depRepo.GetGoPath()) // log.Info("found dep", depRepo.GetGoPath())
if depRepo.GetVersion() != found.GetMasterVersion() { if depRepo.GetVersion() != found.GetMasterVersion() {
check := forge.Repos.FindByFullPath(depRepo.GetGoPath()) check := forge.FindByGoPath(depRepo.GetGoPath())
var ends string var ends string
if check.CheckDirty() { if check.CheckDirty() {
ends = "(dirty) " ends = "(dirty) "
@ -143,7 +143,7 @@ func trimGoSum(check *gitpb.Repo) error {
if good[gopath] { if good[gopath] {
fmt.Fprintf(newf, "%s %s\n", gopath, stuff[gopath]) fmt.Fprintf(newf, "%s %s\n", gopath, stuff[gopath])
fmt.Fprintf(newf, "%s %s\n", gopath, modver[gopath]) fmt.Fprintf(newf, "%s %s\n", gopath, modver[gopath])
check := forge.Repos.FindByFullPath(gopath) check := forge.FindByGoPath(gopath)
if check == nil { if check == nil {
log.Info("gopath does not really exist:", gopath) log.Info("gopath does not really exist:", gopath)
} }

View File

@ -80,7 +80,7 @@ func findPwdRepo() *gitpb.Repo {
gopath := strings.TrimPrefix(pwd, forge.GetGoSrc()) gopath := strings.TrimPrefix(pwd, forge.GetGoSrc())
gopath = strings.Trim(gopath, "/") gopath = strings.Trim(gopath, "/")
log.Info("findRepo() trying gopath", gopath) log.Info("findRepo() trying gopath", gopath)
check = forge.Repos.FindByFullPath(gopath) check = forge.Repos.FindByFullPath(pwd)
if check != nil { if check != nil {
log.Info("findRepo() worked", check.GetGoPath()) log.Info("findRepo() worked", check.GetGoPath())
return check return check