fix for forge.IsReadOnly()

This commit is contained in:
Jeff Carr 2024-12-03 13:24:14 -06:00
parent a6b9170ad0
commit 1048ebc851
2 changed files with 2 additions and 6 deletions

View File

@ -24,7 +24,7 @@ func Init(f *forgepb.Forge, g *gui.Node) *RepoList {
repos := me.forge.Repos.SortByGoPath() repos := me.forge.Repos.SortByGoPath()
for repos.Scan() { for repos.Scan() {
repo := repos.Next() repo := repos.Next()
if me.forge.IsReadOnly(repo.GoPath) { if me.forge.IsReadOnly(repo) {
log.Info("repo scan readonly directory:", repo.FullPath) log.Info("repo scan readonly directory:", repo.FullPath)
} else { } else {
log.Info("repo scan writable directory:", repo.FullPath) log.Info("repo scan writable directory:", repo.FullPath)
@ -50,7 +50,7 @@ func InitBox(f *forgepb.Forge, newbox *gui.Node) *RepoList {
repos := me.forge.Repos.SortByGoPath() repos := me.forge.Repos.SortByGoPath()
for repos.Scan() { for repos.Scan() {
repo := repos.Next() repo := repos.Next()
if me.forge.IsReadOnly(repo.GoPath) { if me.forge.IsReadOnly(repo) {
log.Info("repo scan readonly directory:", repo.FullPath) log.Info("repo scan readonly directory:", repo.FullPath)
} else { } else {
log.Info("repo scan writable directory:", repo.FullPath) log.Info("repo scan writable directory:", repo.FullPath)

View File

@ -62,25 +62,21 @@ func (r *RepoRow) Show2() {
// adds a gui row to the table based off the repo protobuf // adds a gui row to the table based off the repo protobuf
func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) { func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
log.Info("isdir() start")
if !pb.IsDirectory() { if !pb.IsDirectory() {
// this directory doesn't exist anymore // this directory doesn't exist anymore
// was moved, or isn't in the ~/go/src or wherever go.work is // was moved, or isn't in the ~/go/src or wherever go.work is
return nil, errors.New("path is gone: " + pb.FullPath) return nil, errors.New("path is gone: " + pb.FullPath)
} }
log.Info("isdir() end")
test, ok := r.allrepos[pb.GetGoPath()] test, ok := r.allrepos[pb.GetGoPath()]
if ok { if ok {
// this repo gopath was already added // this repo gopath was already added
return test, nil return test, nil
} }
log.Info("isdir() end 2")
status, err := repostatus.NewRepoStatusWindow(pb) status, err := repostatus.NewRepoStatusWindow(pb)
if err != nil { if err != nil {
return nil, err return nil, err
} }
log.Info("isdir() end 3")
newRepo := new(RepoRow) newRepo := new(RepoRow)
newRepo.Status = status newRepo.Status = status
newRepo.pb = pb newRepo.pb = pb