diff options
| author | Jeff Carr <[email protected]> | 2024-02-29 19:51:56 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-29 19:51:56 -0600 |
| commit | e4769df09034e8f5cdea1b941b2e260e91f14c15 (patch) | |
| tree | 589526085557d1a525c35babfa429a254949cd7b /configfile.go | |
| parent | d3c0679fd905246a06eaebdc2a330229def59707 (diff) | |
change for changes in GitPull()
Diffstat (limited to 'configfile.go')
| -rw-r--r-- | configfile.go | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/configfile.go b/configfile.go index 98543c6..78a1527 100644 --- a/configfile.go +++ b/configfile.go @@ -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) } |
