diff options
| author | Jeff Carr <[email protected]> | 2025-07-21 22:24:59 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-07-21 22:24:59 -0500 |
| commit | a21d17dda963eec946ca5f2e40d2a8a9aee9e009 (patch) | |
| tree | 3ff85fa9fc77308e54e4b1cafca09d008d1b6d65 | |
| parent | 5b5d262ce446037c52c661bf5383c6266b0cbe3b (diff) | |
check for "normal" repo states
| -rw-r--r-- | doDirty.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -13,6 +13,12 @@ import ( func doDirty() { doCheckDirtyAndConfigSave() + if allerr := me.forge.RillRepos(checkNormalRepoState); len(allerr) != 0 { + log.Info("Some repos are not in a 'normal' state. error count =", len(allerr)) + for repo, err := range allerr { + log.Info("repo not normal", repo.GetFullPath(), err) + } + } found := findDirty() if argv.Verbose { me.forge.PrintHumanTableDirty(found) @@ -21,6 +27,21 @@ func doDirty() { } } +// 99% of the time, the repos during development should be on your user branch. +// error out if it's not +// this checks to see if a devel and user branch exist +// this needs to run each time in case repos were added manually by the user +// this also verifies that +func checkNormalRepoState(repo *gitpb.Repo) error { + if err := repo.MakeLocalDevelBranch(); err != nil { + return err + } + if repo.GetCurrentBranchName() != repo.GetUserBranchName() { + return repo.CheckoutUser() + } + return nil +} + func straightCheckDirty() int { var count int // var total int @@ -45,6 +66,7 @@ func doCheckDirty(repo *gitpb.Repo) error { return nil } +// recheck every repo's dirty state according to 'git' func doCheckDirtyAndConfigSave() { start := straightCheckDirty() |
