diff options
Diffstat (limited to 'doPull.go')
| -rw-r--r-- | doPull.go | 58 |
1 files changed, 25 insertions, 33 deletions
@@ -48,49 +48,41 @@ func doGitPullNew() error { return fmt.Errorf("not really 'fetch pull'") } - if argv.GitPull.Dirty != nil { - found := findDirty() - me.forge.PrintHumanTableFull(found) + if argv.Force { + now := time.Now() + pullcount := me.forge.RillFuncError(rillPull) + count := me.forge.RillReload() + if count != 0 { + me.forge.ConfigSave() + } + + total, count, nope, _ := IsEverythingOnMaster() + log.Printf("Master branch check. %d total repos. (%d git pulled) (%d not on master branch) (%s) git pull total=%d\n", total, count, nope, shell.FormatDuration(time.Since(now)), pullcount) return nil } - if argv.GitPull.Patches != nil { - check := findReposWithPatches() - me.forge.PrintHumanTableFull(check) - found, err := me.forge.LookupPB(check) - if err != nil { - return err - } - me.forge.PrintHumanTableFull(found) - return nil + check := gitpb.NewRepos() + + if argv.GitPull.Dirty != nil { + check = findDirty() } - if argv.GitPull.Test != nil { - log.Info("list repo's with updates here") - found := doFind() - // me.forge.PrintHumanTable(found) - me.forge.PrintHumanTableFull(found) - /* - // print out the repos - if argv.List.Full { - me.forge.PrintHumanTableFull(found) - } else { - me.forge.PrintHumanTable(found) - } - */ - return nil + if argv.GitPull.Patches != nil { + check = findReposWithPatches() } - now := time.Now() - pullcount := me.forge.RillFuncError(rillPull) - count := me.forge.RillReload() - if count != 0 { - me.forge.ConfigSave() + if check.Len() == 0 { + check = doFind() } - total, count, nope, _ := IsEverythingOnMaster() - log.Printf("Master branch check. %d total repos. (%d git pulled) (%d not on master branch) (%s) git pull total=%d\n", total, count, nope, shell.FormatDuration(time.Since(now)), pullcount) + me.forge.PrintHumanTableFull(check) + found, err := me.forge.LookupPB(check) + if err != nil { + return err + } + me.forge.PrintHumanTableFull(found) return nil + } /* |
