Git over a SpawnProgram: each function takes the git handle a composition root built
with to_git_program, and a cwd handle in its options. The root decides the
environment and git is pinned, so nothing here reads PATH or the host's environment.
A read of the local repo captures with out, where a child with no inherited stdio leads
its own group and loses the terminal. Anything that may prompt runs with run, which stays
in the terminal's foreground group so /dev/tty still reaches ssh, a credential helper,
or a gpg pinentry: every fetch, pull, push, ls-remote, checkout, commit,
and reset. branch -D can't prompt, and runs with run so its output reaches the user.
No function here parses a remote call's output.
A branch or tag name from a caller passes assert_git_ref_name before it reaches git, so it
is never a refspec like :deploy or a:b, a pattern like ma*, or a shorthand like @{-1}.
It's still a name git resolves, so git_checkout detaches HEAD for a tag or a short hash.
An origin goes into argv after --end-of-options, as a ref name does
too, so one beginning with - can't be read as an option like --upload-pack. git pull
drops that marker before it calls git fetch, so git_pull refuses such an origin itself.