pub struct GitSandbox { /* private fields */ }Expand description
A throwaway git repository: owns its TempDir, initialised on
branch main with a deterministic identity (see configure_identity).
Scenario-building goes through the raw git escape
hatch plus the convenience methods — the sandbox deliberately does not
depend on the typed wrapper crates, so it can be a dev-dependency of any
of them.
Implementations§
Source§impl GitSandbox
impl GitSandbox
Sourcepub fn init(tag: &str) -> Self
pub fn init(tag: &str) -> Self
Create and initialise a repository (git init -b main — git ≥ 2.28,
comfortably below the wrappers’ documented floor).
--template= (empty) makes the new repo skip any init template,
so a host-global init.templateDir cannot seed hooks into
.git/hooks — the version-portable complement to the config
isolation in command.
Sourcepub fn write(&self, path: &str, content: &str)
pub fn write(&self, path: &str, content: &str)
Write content to the repo-relative path (creating parent dirs).
Sourcepub fn commit_file(&self, path: &str, content: &str, message: &str)
pub fn commit_file(&self, path: &str, content: &str, message: &str)
Write + stage + commit one file — the everyday scenario step.