diff options
| author | Jeff Carr <[email protected]> | 2025-09-04 09:15:32 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-04 09:15:32 -0500 |
| commit | 5fec66f97cce98793c657e4183b7ade280f5c7f8 (patch) | |
| tree | 70ea0530c41885bae1b867c8352c9007554b5197 /doClean.go | |
| parent | 680069d4ca65c75ce1d7d462d98ce7e9e4c8bfdc (diff) | |
lots more code cleanups
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()) + } + } +} |
