Backport #26325 by @wxiaoguang Fix #26064 Some git commands should use parent context, otherwise it would exit too early (by the default timeout, 10m), and the "cmd.Wait" waits till the pipes are closed. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
88f6f7579c
commit
9451781ebe
1 changed files with 4 additions and 0 deletions
|
@ -74,6 +74,8 @@ func CatFileBatchCheck(ctx context.Context, repoPath string) (WriteCloserError,
|
||||||
Stdin: batchStdinReader,
|
Stdin: batchStdinReader,
|
||||||
Stdout: batchStdoutWriter,
|
Stdout: batchStdoutWriter,
|
||||||
Stderr: &stderr,
|
Stderr: &stderr,
|
||||||
|
|
||||||
|
UseContextTimeout: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = batchStdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String()))
|
_ = batchStdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String()))
|
||||||
|
@ -124,6 +126,8 @@ func CatFileBatch(ctx context.Context, repoPath string) (WriteCloserError, *bufi
|
||||||
Stdin: batchStdinReader,
|
Stdin: batchStdinReader,
|
||||||
Stdout: batchStdoutWriter,
|
Stdout: batchStdoutWriter,
|
||||||
Stderr: &stderr,
|
Stderr: &stderr,
|
||||||
|
|
||||||
|
UseContextTimeout: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = batchStdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String()))
|
_ = batchStdoutWriter.CloseWithError(ConcatenateError(err, (&stderr).String()))
|
||||||
|
|
Loading…
Reference in a new issue