pub fn stop_push(child: Child, grace: Duration, locks: LockLedger)Expand description
What: Stop a running push: ask politely, wait the grace, then kill and collect it, and judge the reference locks it may have left. Why: Git’s own signal handling ends the helpers it started and removes its lock files, and a push that ignores the request cannot outlive the kill. A killed push leaves its lock files, which fail every later Git command on the same refs, so once the push and what it started are gone the locks they hold are swept.
In TS you’d write (pseudocode):
child.kill('SIGTERM'); await Promise.race([exited, delay(graceMs)]) || child.kill('SIGKILL'); locks.sweep(tree.as_slice());