From 9d4be131cf5d9c74d66a6c3d02cbdd7094b94232 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 3 Jul 2018 23:41:36 -0700 Subject: [PATCH] fix: show git error on debug --- internal/git/git.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/git/git.go b/internal/git/git.go index 8f08cbed0..da0678d6c 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -25,10 +25,13 @@ func Run(args ...string) (string, error) { var stderr bytes.Buffer cmd.Stdout = &stdout cmd.Stderr = &stderr - if err := cmd.Run(); err != nil { + err := cmd.Run() + log.WithField("stdout", stdout.String()). + WithField("stderr", stderr.String()). + Debug("git result") + if err != nil { return "", errors.New(stderr.String()) } - log.WithField("output", stdout.String()).Debug("git result") return stdout.String(), nil }