summaryrefslogtreecommitdiff
path: root/doClean.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-25 15:02:36 -0500
committerJeff Carr <[email protected]>2025-09-25 15:02:36 -0500
commita8184b8c9ec61d2bf69aeae78542b9e1888837e1 (patch)
tree18d4cbd802dc25f25a13c44fc06c290d718b93fb /doClean.go
parenta377c2ed273412e7a98870b8005a431df16f4380 (diff)
try to fix weird things with doClean()v0.25.25
Diffstat (limited to 'doClean.go')
-rw-r--r--doClean.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/doClean.go b/doClean.go
index dfc80a9..c9af9cd 100644
--- a/doClean.go
+++ b/doClean.go
@@ -4,9 +4,11 @@
package main
import (
+ "errors"
"fmt"
"path/filepath"
+ "go.wit.com/lib/fhelp"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
@@ -97,7 +99,16 @@ func doClean() error {
// try to delete user
if err := doRepoCleanUser(repo); err != nil {
- log.Info(repo.GetGoPath(), err)
+ if err == ErrorBranchUnique {
+ bname := repo.GetUserBranchName()
+ s := fmt.Sprintf("delete this odd user %bname branch %s?", bname, repo.FullPath)
+ if fhelp.QuestionUser(s) {
+ repo.RunVerbose([]string{"git", "branch", "-D", bname})
+ // repo.RunVerbose([]string{"git", "checkout", bname})
+ }
+ } else {
+ log.Info(repo.GetGoPath(), err)
+ }
}
// try to delete devel
@@ -232,9 +243,14 @@ func doRepoCleanUser(repo *gitpb.Repo) error {
}
}
- return fmt.Errorf("%s branch has unique commits", bruser)
+ if argv.Clean.Fix != nil {
+ }
+
+ return ErrorBranchUnique
}
+var ErrorBranchUnique error = errors.New("branch has unique commits")
+
// if you call this, there is no going back. no checks anymore. nothing
// it deletes the 'devel' branch. git branch -D "devel". END OF STORY
func justDeleteTheDevelBranchAlready(repo *gitpb.Repo) error {