work on using repo.Reload() more smarter

This commit is contained in:
Jeff Carr 2025-09-13 00:51:22 -05:00
parent b5df8f2dad
commit 405ddb6994
3 changed files with 4 additions and 8 deletions

View File

@ -20,15 +20,11 @@ func checkRemoteBranches(repo *gitpb.Repo) error {
} }
if repo.VerifyRemoteAndLocalBranches(repo.GetDevelBranchName()) { if repo.VerifyRemoteAndLocalBranches(repo.GetDevelBranchName()) {
} else { } else {
repo.Reload() return log.Errorf("remote devel is out of sync with local: todo: git pull or git fetch")
me.forge.SetConfigSave(true)
return log.Errorf("remote devel is out of sync with local")
} }
if repo.VerifyRemoteAndLocalBranches(repo.GetMasterBranchName()) { if repo.VerifyRemoteAndLocalBranches(repo.GetMasterBranchName()) {
} else { } else {
repo.Reload() return log.Errorf("remote master is out of sync with local: todo: git pull or git fetch")
me.forge.SetConfigSave(true)
return log.Errorf("remote master is out of sync with local")
} }
return nil return nil
} }

View File

@ -70,7 +70,7 @@ func checkNormalRepoState(repo *gitpb.Repo) error {
configSave = true configSave = true
log.Info("changing to user branch", repo.FullPath) log.Info("changing to user branch", repo.FullPath)
repo.CheckoutUser() repo.CheckoutUser()
repo.Reload() repo.ReloadCheck()
return log.Errorf("now on user branch") return log.Errorf("now on user branch")
} }
return nil return nil

View File

@ -99,7 +99,7 @@ func makeReposWin() *stdReposTableWin {
cmd = []string{"git", "branch", "--delete", "--remote", "origin/" + brname} cmd = []string{"git", "branch", "--delete", "--remote", "origin/" + brname}
log.Info(repo.GetGoPath(), cmd) log.Info(repo.GetGoPath(), cmd)
repo.RunVerbose(cmd) repo.RunVerbose(cmd)
repo.Reload() repo.ReloadCheck()
} }
me.forge.SetConfigSave(true) me.forge.SetConfigSave(true)
me.forge.ConfigSave() me.forge.ConfigSave()