don't query the user until in Normal mode
This commit is contained in:
parent
a8184b8c9e
commit
643c9c9220
27
doNormal.go
27
doNormal.go
|
@ -15,6 +15,7 @@ import (
|
||||||
"go.wit.com/lib/config"
|
"go.wit.com/lib/config"
|
||||||
"go.wit.com/lib/fhelp"
|
"go.wit.com/lib/fhelp"
|
||||||
"go.wit.com/lib/gui/shell"
|
"go.wit.com/lib/gui/shell"
|
||||||
|
"go.wit.com/lib/protobuf/forgepb"
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
@ -34,19 +35,25 @@ func doNormal() bool {
|
||||||
}
|
}
|
||||||
repo := me.forge.Repos.FindByFullPath(path)
|
repo := me.forge.Repos.FindByFullPath(path)
|
||||||
if stat.Err == ErrorLocalDevelBranch {
|
if stat.Err == ErrorLocalDevelBranch {
|
||||||
bname := repo.GetDevelBranchName()
|
if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL {
|
||||||
s := fmt.Sprintf("repair the %s branch on %s", bname, repo.FullPath)
|
bname := repo.GetDevelBranchName()
|
||||||
if fhelp.QuestionUser(s) {
|
s := fmt.Sprintf("repair the %s branch on %s", bname, repo.FullPath)
|
||||||
repo.RunVerbose([]string{"git", "branch", "-D", bname})
|
if fhelp.QuestionUser(s) {
|
||||||
repo.RunVerbose([]string{"git", "checkout", bname})
|
// 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 {
|
if stat.Err == ErrorLocalMasterBranch {
|
||||||
bname := repo.GetMasterBranchName()
|
if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL {
|
||||||
s := fmt.Sprintf("repair the %s branch on %s", bname, repo.FullPath)
|
bname := repo.GetMasterBranchName()
|
||||||
if fhelp.QuestionUser(s) {
|
s := fmt.Sprintf("repair the %s branch on %s", bname, repo.FullPath)
|
||||||
repo.RunVerbose([]string{"git", "branch", "-D", bname})
|
if fhelp.QuestionUser(s) {
|
||||||
repo.RunVerbose([]string{"git", "checkout", bname})
|
// 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)
|
// log.Infof("%-60s, %-60s %v %s\n", stat.Start, stat.End.String(), dur, path)
|
||||||
|
|
Loading…
Reference in New Issue