diff options
Diffstat (limited to 'doClean.go')
| -rw-r--r-- | doClean.go | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -15,7 +15,7 @@ import ( // automatically deletes local devel and user branches func doClean() error { // fix this to work, then delete all the other options for "forge clean' - if err := doAllCheckoutMaster(); err != nil { + if err := me.forge.DoAllCheckoutMaster(); err != nil { // badExit(err) } @@ -215,3 +215,20 @@ func justDeleteTheDevelBranchAlready(repo *gitpb.Repo) error { // _, err := repo.RunVerbose(cmd) return nil } + +func doGitReset() { + all := me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + if me.forge.Config.IsReadOnly(repo.GetGoPath()) { + // log.Info("is readonly", repo.GetGoPath()) + if repo.CheckDirty() { + log.Info("is readonly and dirty", repo.GetGoPath()) + cmd := []string{"git", "reset", "--hard"} + repo.RunRealtime(cmd) + } + } else { + // log.Info("is not readonly", repo.GetGoPath()) + } + } +} |
