summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-25 15:20:52 -0500
committerJeff Carr <[email protected]>2025-09-25 15:20:52 -0500
commit643c9c92202ea2d3fcd8160b65024364e0e708d4 (patch)
tree887f19e81e4865a87097e3a6dd2a1959b2919ffd
parenta8184b8c9ec61d2bf69aeae78542b9e1888837e1 (diff)
don't query the user until in Normal modev0.25.26
-rw-r--r--doNormal.go27
1 files changed, 17 insertions, 10 deletions
diff --git a/doNormal.go b/doNormal.go
index 9f7df78..1f4b53e 100644
--- a/doNormal.go
+++ b/doNormal.go
@@ -15,6 +15,7 @@ import (
"go.wit.com/lib/config"
"go.wit.com/lib/fhelp"
"go.wit.com/lib/gui/shell"
+ "go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
@@ -34,19 +35,25 @@ func doNormal() bool {
}
repo := me.forge.Repos.FindByFullPath(path)
if stat.Err == ErrorLocalDevelBranch {
- bname := repo.GetDevelBranchName()
- s := fmt.Sprintf("repair the %s branch on %s", bname, repo.FullPath)
- if fhelp.QuestionUser(s) {
- repo.RunVerbose([]string{"git", "branch", "-D", bname})
- repo.RunVerbose([]string{"git", "checkout", bname})
+ if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL {
+ bname := repo.GetDevelBranchName()
+ s := fmt.Sprintf("repair the %s branch on %s", bname, repo.FullPath)
+ if fhelp.QuestionUser(s) {
+ // todo, check to make sure we aren't on this branch
+ repo.RunVerbose([]string{"git", "branch", "-D", bname})
+ repo.RunVerbose([]string{"git", "checkout", bname})
+ }
}
}
if stat.Err == ErrorLocalMasterBranch {
- bname := repo.GetMasterBranchName()
- s := fmt.Sprintf("repair the %s branch on %s", bname, repo.FullPath)
- if fhelp.QuestionUser(s) {
- repo.RunVerbose([]string{"git", "branch", "-D", bname})
- repo.RunVerbose([]string{"git", "checkout", bname})
+ if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL {
+ bname := repo.GetMasterBranchName()
+ s := fmt.Sprintf("repair the %s branch on %s", bname, repo.FullPath)
+ if fhelp.QuestionUser(s) {
+ // todo, check to make sure we aren't on this branch
+ repo.RunVerbose([]string{"git", "branch", "-D", bname})
+ repo.RunVerbose([]string{"git", "checkout", bname})
+ }
}
}
// log.Infof("%-60s, %-60s %v %s\n", stat.Start, stat.End.String(), dur, path)