more lame fixes

This commit is contained in:
Jeff Carr 2025-09-13 07:19:28 -05:00
parent 9cdfface3c
commit 30ee1fcdf7
1 changed files with 13 additions and 0 deletions

View File

@ -56,6 +56,7 @@ func checkNormalRepoState(repo *gitpb.Repo) error {
log.Infof("%s != %s\n", repo.FullPath, tmp)
if strings.HasPrefix(repo.FullPath, me.forge.Config.ReposDir) {
tmp = strings.TrimPrefix(repo.FullPath, me.forge.Config.ReposDir)
tmp = strings.Trim(tmp, "/")
repo.Namespace = tmp
err = log.Errorf("namespace set to filepath")
}
@ -63,6 +64,12 @@ func checkNormalRepoState(repo *gitpb.Repo) error {
// log.Infof("%s == %s\n", repo.FullPath, tmp)
}
tmp = strings.Trim(repo.Namespace, "/")
if tmp != repo.Namespace {
err = log.Errorf("junk in ns %s", repo.Namespace)
repo.Namespace = tmp
}
if repo.GetMasterBranchName() == "" {
me.forge.VerifyBranchNames(repo)
log.Info("ABNORMAL: master branch name was blank in", repo.GetFullPath())
@ -92,5 +99,11 @@ func checkNormalRepoState(repo *gitpb.Repo) error {
repo.ReloadCheck()
err = log.Errorf("now on user branch")
}
if me.forge.Config.IsReadOnly(repo.GetGoPath()) != repo.GetReadOnly() {
repo.ReadOnly = me.forge.Config.IsReadOnly(repo.GetGoPath())
log.Info("damnit", repo.FullPath)
err = log.Errorf("readonly bit wrong")
}
return err
}