Skip to content

Commit 5d4c59c

Browse files
authored
Trim whitespace from Git errors (#120)
1 parent 83e9f7c commit 5d4c59c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

providers/gitops/gitops.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (g *ExecGitCommand) Run(ctx context.Context, cmd string, args []string, dir
4444
stdout, err := command.Output()
4545
if err != nil {
4646
if exitErr, ok := err.(*exec.ExitError); ok {
47-
return nil, fmt.Errorf("command `%s` returned an error: %w stderr: %s", command.String(), err, string(exitErr.Stderr))
47+
return nil, fmt.Errorf("command `%s` returned an error: %w stderr: %s", command.String(), err, string(bytes.TrimSpace(exitErr.Stderr)))
4848
}
4949
return nil, fmt.Errorf("error running command: %w", err)
5050
}

0 commit comments

Comments
 (0)