init
ci / test (push) Canceled after 0s
docker / build (push) Canceled after 0s

This commit is contained in:
iceBear67
2026-08-14 07:13:22 +00:00
commit a006483bbc
26 changed files with 3826 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
//go:build unix
package gitx
import (
"syscall"
"time"
)
// sysProcAttr puts git in its own process group so we can signal the whole
// tree — git itself plus the ssh or git-remote-https helper it spawned.
func sysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{Setpgid: true}
}
// terminate asks the process group to exit, then insists.
func terminate(pid int) {
if pid <= 0 {
return
}
_ = syscall.Kill(-pid, syscall.SIGTERM)
time.Sleep(termGrace)
_ = syscall.Kill(-pid, syscall.SIGKILL)
}