fix branch names if they somehow end up blank

This commit is contained in:
Jeff Carr 2025-08-29 10:28:58 -05:00
parent 9bcf2d968c
commit b70417565a
1 changed files with 14 additions and 1 deletions

View File

@ -14,7 +14,7 @@ func doNormal() bool {
if allerr := me.forge.RillRepos(checkNormalRepoState); len(allerr) != 0 {
log.Info("Some repos are not in a 'normal' state. error count =", len(allerr))
for repo, err := range allerr {
log.Info("repo not normal", repo.GetFullPath(), err)
log.Info("ABNORMAL:", repo.GetFullPath(), err)
}
return false
}
@ -27,6 +27,19 @@ 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 {
if repo.GetMasterBranchName() == "" {
me.forge.VerifyBranchNames(repo)
configSave = true
}
if repo.GetMasterBranchName() == "" {
return log.Errorf("master branch name blank")
}
if repo.GetDevelBranchName() == "" {
return log.Errorf("devel branch name blank")
}
if repo.GetUserBranchName() == "" {
return log.Errorf("user branch name blank")
}
if _, err := repo.MakeLocalDevelBranch(); err != nil {
return err
}