Feed child process stdin via a temporary file. This is simpler than
opening a pipe and spawning a thread that feeds the pipe, when it's
not full.
Capture child stderr into a buffer without trying to let the
caller (another thread) process it line by line. We don't seem to have
use for that, and this simplifies things a fair bit.
Simplify the capture of child stdout to use a simpler thread and data
structure, compared to the previous multi-thread setup. Splitting
stdout into lines is now done by the thread that consumes the lines,
making the code that captures it simpler.
Also update the timeout subcommand to work with the changes. Other
callers of this code aren't yet updated.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
While setting up a Nix flake, a series of tests were failing due to shell
invocations. The falling were the changes required:
- Use `!#/bin/sh` instead of `!#/bin/bash`
- Use `$$` instead of `$BASHPID`
- Use `true` and `false` instead of `/bin/true` and `/bin/false`
It was also noted that the `git-remote-helper` is needed alongside the `rad`
binary for some of the acceptance tests to work.