summaryrefslogtreecommitdiff
path: root/configfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'configfile.go')
-rw-r--r--configfile.go24
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)
}