diff options
Diffstat (limited to 'doClean.go')
| -rw-r--r-- | doClean.go | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -7,13 +7,36 @@ import ( "fmt" "path/filepath" + "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) +func checkRemoteBranches(repo *gitpb.Repo) error { + if repo.VerifyRemoteAndLocalBranches(repo.GetDevelBranchName()) { + repo.Reload() + me.forge.SetConfigSave(true) + return log.Errorf("devel is bad") + } + if repo.VerifyRemoteAndLocalBranches(repo.GetMasterBranchName()) { + repo.Reload() + me.forge.SetConfigSave(true) + return log.Errorf("master is bad") + } + return nil +} + // reverts all repos back to the original master branches // automatically deletes local devel and user branches func doClean() error { + me.forge.Config.Mode = forgepb.ForgeMode_CLEAN + + if argv.Clean.Verify != nil { + stats := me.forge.RillRepos(checkRemoteBranches) + _ = stats + return nil + } + // fix this to work, then delete all the other options for "forge clean' if err := me.forge.DoAllCheckoutMaster(); err != nil { // badExit(err) |
