// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 package forgepb import ( "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" "google.golang.org/protobuf/proto" ) func (f *Forge) PrepareCheckRepos() *gitpb.Repos { submit := gitpb.NewRepos() for repo := range f.Repos.IterByFullPath() { newrepo := new(gitpb.Repo) newrepo.Namespace = repo.Namespace newrepo.URL = repo.URL newrepo.Tags = gitpb.NewGitTags() if repo.Tags == nil { log.Infof("%s no tags\n", repo.FullPath) continue } if repo.Tags.Master != nil { newrepo.Tags.Master = proto.Clone(repo.Tags.Master).(*gitpb.GitTag) } else { log.Infof("no master tag %s\n", repo.FullPath) } if repo.Tags.Devel != nil { newrepo.Tags.Devel = proto.Clone(repo.Tags.Devel).(*gitpb.GitTag) } submit.Append(newrepo) } return submit } func (f *Forge) PrepareCheckRepo(namespace string) *gitpb.Repo { found := f.Repos.FindByNamespace(namespace) if found == nil { return nil } newrepo := new(gitpb.Repo) newrepo.Namespace = found.Namespace newrepo.URL = found.URL newrepo.Tags = gitpb.NewGitTags() if found.Tags == nil { log.Infof("%s Tags == nil\n", found.FullPath) return newrepo } if found.Tags.Master != nil { newrepo.Tags.Master = proto.Clone(found.Tags.Master).(*gitpb.GitTag) } else { log.Infof("no master tag %s\n", found.FullPath) } if found.Tags.Devel != nil { newrepo.Tags.Devel = proto.Clone(found.Tags.Devel).(*gitpb.GitTag) } return newrepo }