summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-23 19:53:55 -0500
committerJeff Carr <[email protected]>2025-09-23 19:53:55 -0500
commit9aa0c188b0b3fc86d396e3421385356462594d42 (patch)
tree991cc2d1317caccf458241926020ef64f47a8a18
parent843d9fbb8d31b2735621d02631924155615d97f6 (diff)
try to fix out of sync local branchesv0.0.134
-rw-r--r--reload.go7
1 files changed, 7 insertions, 0 deletions
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
}