Skip to content

Commit 7ff3463

Browse files
committed
fix
1 parent 85681d6 commit 7ff3463

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/git/gitcmd/command.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,14 +472,13 @@ func (c *Command) RunStdBytes(ctx context.Context) (stdout, stderr []byte, runEr
472472

473473
stdoutBuf := &bytes.Buffer{}
474474
stderrBuf := &bytes.Buffer{}
475-
476475
err := c.WithParentCallerInfo().
477476
WithStdout(stdoutBuf).
478477
WithStderr(stderrBuf).
479478
Run(ctx)
480479
if err != nil {
481-
return nil, stderr, &runStdError{err: err, stderr: util.UnsafeBytesToString(stderr)}
480+
return nil, stderrBuf.Bytes(), &runStdError{err: err, stderr: util.UnsafeBytesToString(stderrBuf.Bytes())}
482481
}
483482
// even if there is no err, there could still be some stderr output
484-
return stdoutBuf.Bytes(), stderr, nil
483+
return stdoutBuf.Bytes(), stderrBuf.Bytes(), nil
485484
}

0 commit comments

Comments
 (0)