From 9aa0c188b0b3fc86d396e3421385356462594d42 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 23 Sep 2025 19:53:55 -0500 Subject: try to fix out of sync local branches --- reload.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reload.go b/reload.go index 99859ba..0016295 100644 --- a/reload.go +++ b/reload.go @@ -1,10 +1,12 @@ package gitpb import ( + "fmt" "strings" "time" "go.wit.com/lib/config" + "go.wit.com/lib/fhelp" "go.wit.com/log" timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) @@ -93,6 +95,11 @@ func (repo *Repo) VerifyRemoteAndLocalBranches(bname string) bool { return true } else { log.Info(lh, rh, "local != remote", repo.FullPath, bname) + s := fmt.Sprintf("repair the %s branch", bname) + if fhelp.QuestionUser(s) { + repo.RunVerbose([]string{"git", "branch", "-D", bname}) + repo.RunVerbose([]string{"git", "checkout", bname}) + } } return false } -- cgit v1.2.3