From e6e70ccaa50a73e571e3251010e06847ad232829 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Jan 2025 21:22:54 -0600 Subject: [PATCH] add a way to force git checkout anyway --- gitCheckout.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gitCheckout.go b/gitCheckout.go index a3c60a0..135dfaf 100644 --- a/gitCheckout.go +++ b/gitCheckout.go @@ -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