summaryrefslogtreecommitdiff
path: root/doNormal.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-13 07:09:13 -0500
committerJeff Carr <[email protected]>2025-09-13 07:09:13 -0500
commit9cdfface3cf26fe9055c0607033ec121b6cd734c (patch)
treecda2fdfd8c94b0e6cd9bb0fe1fb730b14ecf6e17 /doNormal.go
parentc463ec70f0ef46851ea009bcfd8e261a1e3bb97c (diff)
moved to new dir scan
Diffstat (limited to 'doNormal.go')
-rw-r--r--doNormal.go30
1 files changed, 22 insertions, 8 deletions
diff --git a/doNormal.go b/doNormal.go
index 4c773d0..2973251 100644
--- a/doNormal.go
+++ b/doNormal.go
@@ -6,8 +6,11 @@ package main
// checks that repos are in a "normal" state
import (
+ "path/filepath"
+ "strings"
"time"
+ "go.wit.com/lib/config"
"go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
@@ -35,7 +38,7 @@ func doNormal() bool {
log.Info("Some repos are not in a 'normal' state. error count =", count)
log.Info("TODO: list the repos here. forge patch repos?")
dumpWorkRepos()
- configSave = true
+ config.SetChanged("repos", true)
return false
}
return true
@@ -47,19 +50,31 @@ func doNormal() bool {
// this needs to run each time in case repos were added manually by the user
// this also verifies that
func checkNormalRepoState(repo *gitpb.Repo) error {
+ var err error
+ tmp := filepath.Join(me.forge.Config.ReposDir, repo.GetNamespace())
+ if tmp != repo.FullPath {
+ 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)
+ repo.Namespace = tmp
+ err = log.Errorf("namespace set to filepath")
+ }
+ } else {
+ // log.Infof("%s == %s\n", repo.FullPath, tmp)
+ }
+
if repo.GetMasterBranchName() == "" {
me.forge.VerifyBranchNames(repo)
- configSave = true
log.Info("ABNORMAL: master branch name was blank in", repo.GetFullPath())
}
if repo.GetMasterBranchName() == "" {
- return log.Errorf("master branch name blank")
+ err = log.Errorf("master branch name blank")
}
if repo.GetDevelBranchName() == "" {
- return log.Errorf("devel branch name blank")
+ err = log.Errorf("devel branch name blank")
}
if repo.GetUserBranchName() == "" {
- return log.Errorf("user branch name blank")
+ err = log.Errorf("user branch name blank")
}
if repo.GetGoPath() == repo.GetNamespace() {
// log.Info(repo.FullPath, "gopath == namespace", repo.GetGoPath(), repo.GetNamespace())
@@ -72,11 +87,10 @@ func checkNormalRepoState(repo *gitpb.Repo) error {
repo.VerifyRemoteAndLocalBranches(repo.GetMasterBranchName())
if repo.GetCurrentBranchName() != repo.GetUserBranchName() {
- configSave = true
log.Info("changing to user branch", repo.FullPath)
repo.CheckoutUser()
repo.ReloadCheck()
- return log.Errorf("now on user branch")
+ err = log.Errorf("now on user branch")
}
- return nil
+ return err
}