Change git.cmd to RunWithContext (#18693)
Change all `cmd...Pipeline` commands to `cmd.RunWithContext`. #18553 Co-authored-by: Martin Scholz <martin.scholz@versasec.com>
This commit is contained in:
parent
393ea86ae1
commit
26718a785a
28 changed files with 530 additions and 155 deletions
|
@ -486,7 +486,12 @@ func GetCommitFileStatus(ctx context.Context, repoPath, commitID string) (*Commi
|
|||
stderr := new(bytes.Buffer)
|
||||
args := []string{"log", "--name-status", "-c", "--pretty=format:", "--parents", "--no-renames", "-z", "-1", commitID}
|
||||
|
||||
err := NewCommand(ctx, args...).RunInDirPipeline(repoPath, w, stderr)
|
||||
err := NewCommand(ctx, args...).RunWithContext(&RunContext{
|
||||
Timeout: -1,
|
||||
Dir: repoPath,
|
||||
Stdout: w,
|
||||
Stderr: stderr,
|
||||
})
|
||||
w.Close() // Close writer to exit parsing goroutine
|
||||
if err != nil {
|
||||
return nil, ConcatenateError(err, stderr.String())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue