From 5fec66f97cce98793c657e4183b7ade280f5c7f8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 4 Sep 2025 09:15:32 -0500 Subject: lots more code cleanups --- doClean.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'doClean.go') diff --git a/doClean.go b/doClean.go index 51230c6..43057c4 100644 --- a/doClean.go +++ b/doClean.go @@ -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()) + } + } +} -- cgit v1.2.3