diff options
Diffstat (limited to 'reload.go')
| -rw-r--r-- | reload.go | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -61,7 +61,7 @@ func (repo *Repo) SetUserBranchName(bname string) { // updates LastTag // todo, get this from the protobuf func (repo *Repo) setLastTag() { cmd := []string{"git", "rev-list", "--tags", "--max-count=1"} - result := repo.RunQuiet(cmd) + result, _ := repo.RunQuiet(cmd) // log.Info("getLastTagVersion()", result.Stdout) if len(result.Stdout) != 1 { @@ -73,7 +73,7 @@ func (repo *Repo) setLastTag() { hash := result.Stdout[0] cmd = []string{"git", "describe", "--tags", "--always", hash} - result = repo.RunQuiet(cmd) + result, _ = repo.RunQuiet(cmd) if len(result.Stdout) != 1 { log.Log(WARN, "git LastTag() error:", result.Stdout, "hash =", hash) @@ -86,10 +86,10 @@ func (repo *Repo) setLastTag() { func (repo *Repo) setCurrentBranchName() { repo.CurrentBranchName = "" - r := repo.RunQuiet([]string{"git", "branch", "--show-current"}) + r, err := repo.RunQuiet([]string{"git", "branch", "--show-current"}) output := strings.Join(r.Stdout, "\n") - if r.Error != nil { - log.Log(WARN, "GetCurrentBranchName() not in a git repo?", r.Error, repo.GetGoPath()) + if err != nil { + log.Log(WARN, "GetCurrentBranchName() not in a git repo?", err, repo.GetGoPath()) log.Log(WARN, "GetCurrentBranchName() output might have worked anyway:", output) } repo.CurrentBranchName = strings.TrimSpace(output) @@ -102,10 +102,10 @@ func (repo *Repo) setCurrentBranchVersion() { log.Info("repo.GetCurrentBranchVersion() repo == nil") return } - r := repo.RunQuiet([]string{"git", "describe", "--tags", "--always"}) + r, err := repo.RunQuiet([]string{"git", "describe", "--tags", "--always"}) output := strings.Join(r.Stdout, "\n") - if r.Error != nil { - log.Log(WARN, "GetCurrentBranchVersion() not in a git repo?", r.Error, repo.GetGoPath()) + if err != nil { + log.Log(WARN, "GetCurrentBranchVersion() not in a git repo?", err, repo.GetGoPath()) log.Log(WARN, "GetCurrentBranchVersion() output might have worked anyway:", output) } repo.CurrentBranchVersion = strings.TrimSpace(output) |
