summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}