Skip to content

Commit

Permalink
log rawGit execution error output
Browse files Browse the repository at this point in the history
Signed-off-by: Jeeva Kandasamy <[email protected]>
  • Loading branch information
jkandasa authored and tekton-robot committed Jun 25, 2024
1 parent 4dcc564 commit 531f54d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions api/pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}

0 comments on commit 531f54d

Please sign in to comment.