mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
6fcb36ff14
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
23 lines
333 B
Go
23 lines
333 B
Go
// +build windows
|
|
|
|
package git
|
|
|
|
import (
|
|
"context"
|
|
"os/exec"
|
|
)
|
|
|
|
func runProcessGroup(ctx context.Context, cmd *exec.Cmd) error {
|
|
if err := cmd.Start(); err != nil {
|
|
return err
|
|
}
|
|
waitDone := make(chan struct{})
|
|
go func() {
|
|
select {
|
|
case <-ctx.Done():
|
|
cmd.Process.Kill()
|
|
case <-waitDone:
|
|
}
|
|
}()
|
|
return cmd.Wait()
|
|
}
|