diff options
| -rw-r--r-- | doPull.go | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -7,6 +7,7 @@ import ( "strings" "time" + "go.wit.com/lib/config" "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" @@ -165,16 +166,31 @@ func doPull() error { } if argv.Pull.Force || argv.Force { - now := time.Now() stats := me.forge.RillFuncError(rillPull) count := me.forge.RillReload() if count != 0 { me.forge.ConfigSave() } - - total, count, nope, _ := me.forge.IsEverythingOnMaster() - log.Printf("Master branch check. %d total repos. (%d git pulled) (%d not on master branch) (%s) git pull total=FIXME%d\n", total, count, nope, shell.FormatDuration(time.Since(now)), len(stats)) - return nil + repoerr := gitpb.NewRepos() + for path, stat := range stats { + if stat.Err == nil { + continue + } + repo := me.forge.Repos.FindByFullPath(path) + if repo == nil { + log.Info("path deleted while running?", path) + continue + } + r := repoerr.Append(repo) + r.State = "git pull failed" + dur := stat.End.Sub(stat.Start) + if dur > 1*time.Second { + msg := log.Sprintf("pull time (%s)", config.FormatDuration(dur)) + r.State = msg + } + } + me.forge.PrintPullTable(repoerr) + me.sh.GoodExit("git pull done") } log.Info("do a pull check here?") |
