diff options
Diffstat (limited to 'doClean.go')
| -rw-r--r-- | doClean.go | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -94,17 +94,18 @@ func doClean() error { // when publishing, clean out the details of that if it's still there if repo.GetTargetVersion() != "" { repo.SetTargetVersion("") - configSave = true } // try to delete user if err := doRepoCleanUser(repo); err != nil { if err == ErrorBranchUnique { - bname := repo.GetUserBranchName() - s := fmt.Sprintf("delete this odd user %bname branch %s?", bname, repo.FullPath) - if fhelp.QuestionUser(s) { - repo.RunVerbose([]string{"git", "branch", "-D", bname}) - // repo.RunVerbose([]string{"git", "checkout", bname}) + if argv.Clean.Fix != nil { + bname := repo.GetUserBranchName() + s := fmt.Sprintf("delete this odd user (%s) branch %s?", bname, repo.FullPath) + if fhelp.QuestionUser(s) { + repo.RunVerbose([]string{"git", "branch", "-D", bname}) + // repo.RunVerbose([]string{"git", "checkout", bname}) + } } } else { log.Info(repo.GetGoPath(), err) @@ -187,13 +188,14 @@ func doRepoCleanDevel(repo *gitpb.Repo) error { } if err := justDeleteTheDevelBranchAlready(repo); err != nil { log.Info("justDeleteTheDevel() err", repo.GetGoPath(), err) - bname := repo.GetDevelBranchName() - s := fmt.Sprintf("delete this odd devel %bname branch %s?", bname, repo.FullPath) - if fhelp.QuestionUser(s) { - repo.RunVerbose([]string{"git", "branch", "-D", bname}) - // repo.RunVerbose([]string{"git", "checkout", bname}) + if argv.Clean.Fix != nil { + bname := repo.GetDevelBranchName() + s := fmt.Sprintf("delete this odd devel (%s) branch %s?", bname, repo.FullPath) + if fhelp.QuestionUser(s) { + repo.RunVerbose([]string{"git", "branch", "-D", bname}) + // repo.RunVerbose([]string{"git", "checkout", bname}) + } } - configSave = true return err } return nil |
