add a way to force git checkout anyway

This commit is contained in:
Jeff Carr 2025-01-07 21:22:54 -06:00
parent 67ae8d8773
commit e6e70ccaa5
1 changed files with 22 additions and 0 deletions

View File

@ -133,6 +133,28 @@ func (f *Forge) CheckoutMaster() bool {
}
func (f *Forge) CheckoutUser() bool {
log.Log(FORGEPBWARN, "running git checkout user everwhere")
var failed int = 0
var count int = 0
all := f.Repos.SortByFullPath()
for all.Scan() {
repo := all.Next()
count += 1
if repo.GetCurrentBranchName() == repo.GetUserBranchName() {
// already on the user branch
continue
}
if repo.CheckoutUser() {
// checkout ok
} else {
failed += 1
}
}
log.Log(FORGEPBWARN, "Ran git checkout in", count, "repos. failure count =", failed)
return true
}
func (f *Forge) CheckoutUserForce() bool {
log.Log(FORGEPBWARN, "running git checkout user everwhere")
var failed int = 0
var count int = 0