summaryrefslogtreecommitdiff
path: root/doClean.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-08-19 22:20:40 -0500
committerJeff Carr <[email protected]>2025-08-19 22:20:40 -0500
commit47cd26fbab64cba0fdcc5c23d45c7472aa6304bc (patch)
tree12f829bd99d9738a96139c297697578917fd5796 /doClean.go
parent650ecc6aabd12e9a2ca39902a93e1d64a79d8fe9 (diff)
more "commit" tests
Diffstat (limited to 'doClean.go')
-rw-r--r--doClean.go54
1 files changed, 5 insertions, 49 deletions
diff --git a/doClean.go b/doClean.go
index 05f5272..4b435b3 100644
--- a/doClean.go
+++ b/doClean.go
@@ -28,13 +28,15 @@ func doClean() error {
if repo.IsDirty() {
continue
}
+
+ // when publishing, clean out the details of that if it's still there
if repo.GetTargetVersion() != "" {
repo.SetTargetVersion("")
configSave = true
}
// try to delete user
- if err := doCleanUserRepo(repo); err != nil {
+ if err := doRepoCleanUser(repo); err != nil {
log.Info(repo.GetGoPath(), err)
}
@@ -70,38 +72,8 @@ func doRepoCleanDevel(repo *gitpb.Repo) error {
return nil
}
-func doCleanDevel() error {
- var total int
- var count int
- all := me.forge.Repos.SortByFullPath()
- for all.Scan() {
- repo := all.Next()
- total += 1
- if !repo.IsLocalBranch(repo.GetDevelBranchName()) {
- // there is no local branch named 'devel'
- continue
- }
-
- if repo.GetCurrentBranchName() != repo.GetMasterBranchName() {
- log.Info("Repo not on master branch:", repo.GetGoPath())
- continue
- }
- if repo.IsDirty() {
- log.Info("Repo is dirty:", repo.GetGoPath())
- continue
- }
- count += 1
- if err := justDeleteTheDevelBranchAlready(repo); err != nil {
- log.Info("justDeleteTheDevel() err", repo.GetGoPath(), err)
- }
- }
- log.Info("")
- log.Printf("attempted cleaning %d devel branches of %d total branches\n", count, total)
- return nil
-}
-
-// removes all local branches
-func doCleanUserRepo(repo *gitpb.Repo) error {
+// removes all local user branches
+func doRepoCleanUser(repo *gitpb.Repo) error {
if repo.IsDirty() {
return nil
}
@@ -153,22 +125,6 @@ func doCleanUserRepo(repo *gitpb.Repo) error {
return fmt.Errorf("%s branch has unique commits", bruser)
}
-// hack to cleanup release versioning info
-func doCleanPub() error {
- total := 0
- all := me.forge.Repos.SortByFullPath()
- for all.Scan() {
- repo := all.Next()
- if repo.GetTargetVersion() != "" {
- repo.SetTargetVersion("")
- configSave = true
- total += 1
- }
- }
- log.Printf("clearing %d total repos\n", total)
- return nil
-}
-
// 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 {