Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log rawGit execution error output #1731

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}