summaryrefslogtreecommitdiff
path: root/doClean.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-04 09:15:32 -0500
committerJeff Carr <[email protected]>2025-09-04 09:15:32 -0500
commit5fec66f97cce98793c657e4183b7ade280f5c7f8 (patch)
tree70ea0530c41885bae1b867c8352c9007554b5197 /doClean.go
parent680069d4ca65c75ce1d7d462d98ce7e9e4c8bfdc (diff)
lots more code cleanups
Diffstat (limited to 'doClean.go')
-rw-r--r--doClean.go19
1 files changed, 18 insertions, 1 deletions
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())
+ }
+ }
+}