diff options
| author | Jeff Carr <[email protected]> | 2025-08-17 23:44:46 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-17 23:44:46 -0500 |
| commit | 25cee2b0134413d8501dc808a866a921bf995a7d (patch) | |
| tree | 354ecce9d76b2c19cd459cde6215cf3f656a6a42 /branches.go | |
| parent | 0de26aee43600bec508ea19d6ababe0c1ea5cd9a (diff) | |
add a check for all repos on masterv0.0.114
Diffstat (limited to 'branches.go')
| -rw-r--r-- | branches.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/branches.go b/branches.go new file mode 100644 index 0000000..7aa1712 --- /dev/null +++ b/branches.go @@ -0,0 +1,28 @@ +package forgepb + +import "go.wit.com/log" + +var ErrorNotAllReposOnMaster error = log.Errorf("not all repos on are on the master branch") +var ErrorNotAllReposOnDevel error = log.Errorf("not all repos on are on the devel branch") +var ErrorNotAllReposOnUser error = log.Errorf("not all repos on are on the user branch") + +func (f *Forge) IsEverythingOnMaster() (int, int, int, error) { + var total int + var count int + var nope int + + // first make sure every repo is on the master branch + for repo := range f.Repos.IterAll() { + total += 1 + if repo.GetMasterBranchName() == repo.GetCurrentBranchName() { + count += 1 + } else { + nope += 1 + } + } + if total != count { + // log.Info(ErrorNotAllReposOnMaster) + return total, count, nope, ErrorNotAllReposOnMaster + } + return total, count, nope, nil +} |
