From e2e0c8cea3a335389127a5372113a25a329ae31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Thu, 25 Apr 2019 18:39:03 +0200 Subject: [PATCH] Fix log messages (#152) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Reinhard Nägele --- pkg/chart/chart.go | 4 ++-- pkg/tool/git.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/chart/chart.go b/pkg/chart/chart.go index 5c24cdab..e9a241e5 100644 --- a/pkg/chart/chart.go +++ b/pkg/chart/chart.go @@ -269,7 +269,7 @@ func (t *Testing) processCharts(action func(chart *Chart) TestResult) ([]TestRes return results, nil } - charts := []*Chart{} + var charts []*Chart for _, dir := range chartDirs { chart, err := NewChart(dir) if err != nil { @@ -647,7 +647,7 @@ func (t *Testing) FindChartDirsToBeProcessed() ([]string, error) { func (t *Testing) computeMergeBase() (string, error) { err := t.git.ValidateRepository() if err != nil { - return "", fmt.Errorf("Must be in a git repository") + return "", errors.New("Must be in a git repository") } return t.git.MergeBase(fmt.Sprintf("%s/%s", t.config.Remote, t.config.TargetBranch), "HEAD") } diff --git a/pkg/tool/git.go b/pkg/tool/git.go index 8fc2f17e..2e499bde 100644 --- a/pkg/tool/git.go +++ b/pkg/tool/git.go @@ -72,5 +72,6 @@ func (g Git) GetUrlForRemote(remote string) (string, error) { } func (g Git) ValidateRepository() error { - return g.exec.RunProcess("git", "rev-parse", "--is-inside-work-tree") + _, err := g.exec.RunProcessAndCaptureOutput("git", "rev-parse", "--is-inside-work-tree") + return err }