change for changes in GitPull()
This commit is contained in:
parent
d3c0679fd9
commit
e4769df090
|
@ -1,13 +1,14 @@
|
|||
package repolist
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"go.wit.com/log"
|
||||
"go.wit.com/lib/gui/repostatus"
|
||||
)
|
||||
|
||||
func (v *RepoList) InitRepoList(cfgfile string) {
|
||||
|
@ -115,30 +116,21 @@ func (rl *RepoList) ArgGitPull() bool {
|
|||
log.Log(REPOWARN, "running git pull everywhere")
|
||||
var failed int = 0
|
||||
for _, repo := range rl.AllRepos() {
|
||||
log.Log(REPOWARN, "Running:", repo.Status.Path())
|
||||
if err := repo.Status.GitPull(); err == nil {
|
||||
if out, err := repo.Status.GitPull(); err == nil {
|
||||
log.Log(REPOWARN, "Ran git pull ok", repo.Status.Path(), out)
|
||||
} else {
|
||||
failed += 1
|
||||
repo.Status.DumpTags()
|
||||
name := repo.Status.GetCurrentBranchName()
|
||||
if repo.Status.IsOnlyLocalTag(name) {
|
||||
log.Log(REPOWARN, repo.Status.Path(), "can not git pull on local only branch", name, err)
|
||||
} else {
|
||||
log.Log(REPOWARN, repo.Status.Path(), "this branch should have worked", name, err)
|
||||
}
|
||||
if fmt.Sprint(err) == "git config error" {
|
||||
badmap += 1
|
||||
continue
|
||||
}
|
||||
if fmt.Sprint(err) == "local only" {
|
||||
if errors.Is(repostatus.ErrorGitPullOnLocal, err) {
|
||||
localonly += 1
|
||||
continue
|
||||
}
|
||||
return false
|
||||
badmap += 1
|
||||
log.Log(REPOWARN, "bad unknown git error", repo.Status.Path(), out, err)
|
||||
}
|
||||
}
|
||||
log.Log(REPOWARN, "Ran git pull in all repos. failure count =", failed)
|
||||
log.Log(REPOWARN, "Ran git pull in all repos. git config map errors =", badmap)
|
||||
log.Log(REPOWARN, "Ran git pull in all repos. bad errors =", badmap)
|
||||
if localonly != 0 {
|
||||
log.Log(REPOWARN, "Ran git pull in all repos. ignored local only branches =", localonly)
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ func GuireleaserView(parent *gui.Node) *RepoList {
|
|||
me.reposgrid.NewLabel("Current")
|
||||
me.reposgrid.NewLabel("Version")
|
||||
me.reposgrid.NewLabel("git State")
|
||||
me.reposgrid.NewLabel("GO State")
|
||||
// me.reposgrid.NewLabel("GO State")
|
||||
me.reposgrid.NextRow()
|
||||
|
||||
me.blind = gui.RawBox()
|
||||
|
|
Loading…
Reference in New Issue