diff --git a/api/pkg/git/git.go b/api/pkg/git/git.go index 5f9c2e2d12..030230080c 100644 --- a/api/pkg/git/git.go +++ b/api/pkg/git/git.go @@ -146,8 +146,12 @@ func git(log *zap.SugaredLogger, kind string, args ...string) (string, error) { output, err := rawGit(kind, args...) if err != nil { - log.Errorf("git %s : error %s ;output: %s", strings.Join(args, " "), err.Error(), output) - return "", err + log.Errorw( + "executedCommand", fmt.Sprintf("git %s", strings.Join(args, " ")), + "executedCommandOutput", output, + err, + ) + return output, err } return output, nil } @@ -162,8 +166,6 @@ func rawGit(dir string, args ...string) (string, error) { if dir != "" { c.Dir = dir } - if err := c.Run(); err != nil { - return "", err - } - return output.String(), nil + err := c.Run() + return output.String(), err }