summaryrefslogtreecommitdiff
path: root/doCommon.go
diff options
context:
space:
mode:
Diffstat (limited to 'doCommon.go')
-rw-r--r--doCommon.go27
1 files changed, 24 insertions, 3 deletions
diff --git a/doCommon.go b/doCommon.go
index 85beb01..296f1cb 100644
--- a/doCommon.go
+++ b/doCommon.go
@@ -35,22 +35,43 @@ func doGitPull() {
}
func doFix() {
- var fixed bool = false
all := me.found.SortByGoPath()
for all.Scan() {
repo := all.Next()
if !repo.IsValid() {
log.Printf("%10s %-50s", "old?\n", repo.GoPath)
me.forge.Repos.DeleteByGoPath(repo.GoPath)
- fixed = true
+ configSave = true
continue
}
log.Printf("running on: %-50s\n", repo.GetGoPath())
cmd := []string{"ls"}
repo.Run(cmd)
+ if err := checkoutBranches(repo); err != nil {
+ badExit(err)
+ }
}
- if fixed {
+ if configSave {
me.forge.Repos.ConfigSave()
okExit("config saved")
}
}
+
+func checkoutBranches(repo *gitpb.Repo) error {
+ dname := repo.GetDevelBranchName()
+ if dname == "" {
+ if err := me.forge.MakeDevelBranch(repo); err != nil {
+ log.Info("verify() no devel branch name", repo.GoPath)
+ return err
+ }
+ configSave = true
+ }
+ if repo.GetUserBranchName() == "" {
+ if err := me.forge.MakeUserBranch(repo); err != nil {
+ log.Info("verify() no devel branch name", repo.GoPath)
+ return err
+ }
+ configSave = true
+ }
+ return nil
+}