diff options
| -rw-r--r-- | reload.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 } |
