This commit is contained in:
Ian Gulliver
2026-10-20 22:49:11 -07:00
parent 4f7d05021a
commit 99401670ee
7 changed files with 53 additions and 40 deletions
+3 -6
View File
@@ -11,8 +11,9 @@ import (
"slices"
"strconv"
"strings"
"syscall"
"time"
"g.fc.run/ai/byre/internal/procgroup"
)
type RepoInfo struct {
@@ -435,14 +436,10 @@ func runNetwork(ctx context.Context, dir string, args ...string) (string, string
}
func runCodeInput(ctx context.Context, dir string, env []string, stdin io.Reader, args ...string) (string, string, int, error) {
cmd := exec.CommandContext(ctx, "git", args...)
cmd := procgroup.CommandContext(ctx, "git", args...)
cmd.Dir = dir
cmd.Env = append(os.Environ(), env...)
cmd.Stdin = stdin
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
cmd.Cancel = func() error {
return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
}
cmd.WaitDelay = 5 * time.Second
stderr := &strings.Builder{}
cmd.Stderr = stderr