Skip to main content

Module git_command

Module git_command 

Source
Expand description

The shared constructor every production git / gh spawn goes through.

GIT_DIR / GIT_WORK_TREE / GIT_COMMON_DIR override -C and current_dir outright, so without the scrub a forge launched from a git hook, a git rebase --exec, or any shell that exported them answers every question about every repo from one foreign repo - at exit 0, with nothing in the output to say so. Positioning the process (-C for git, current_dir for gh) and args stay with the call site; nothing there may set a repo-location variable.

Re-exports§

use std::collections::HashMap; 🔒
use std::process::Command; 🔒

Enums§

SshCommand 🔒
Whether forge builds the ssh command for a child, or the checkout does.

Constants§

AMBIENT_IDENTITY_VARS 🔒
The environment variables gh reads for auth, in its own precedence order; GITHUB_PAT_TOKEN is not one of them, but the environment that carries the hazard declares it beside the two that are.

Functions§

clear_git_point 🔒
Drop a directory’s pointer, back to the machine’s git.
command 🔒
A git / gh spawn with the ambient repo-location env scrubbed, for synchronous callers anywhere in the crate (the plugin rollback’s marketplace-clone git steps included).
gh_tokio_command 🔒
A gh spawn for one project’s own work: command’s scrub, the ambient identity removed, then the project’s declared env applied - so a project that declares its own token acts as that project, and one that declares none falls back to gh’s own login rather than silently to the server’s environment.
git_programs 🔒
network_tokio_git_command 🔒
A git child that may reach a remote.
point_git_at 🔒
Point every git spawn positioned at cwd at program, for this process’s tests and for a crate whose fixtures build on the testing feature. Keyed by directory so parallel cases never run the machine’s git through another case’s wrapper.
test_git_program 🔒
tokio_command 🔒
The command variant async callers await; the scrub rides the std -> tokio conversion.
tokio_git_command 🔒
A git spawn positioned at cwd.