test(git): silence bare repository fixtures

Two subprocess tests invoked git init through an inherited stdout and stderr without quiet mode. Clean Nix builds therefore printed Git's default-branch advice and repository initialization message twice in the test log.

Initialize the fixture explicitly on main and pass --quiet so it is independent of ambient branch configuration and emits no routine setup output. Production subprocess behavior is unchanged.

Validation: cargo fmt --all -- --check; cargo test -p ngit-grasp --lib git::subprocess::tests:: -- --nocapture.

Assisted-by: Codex (GPT-5)
This commit is contained in:
DanConwayDev
2026-09-10 10:03:02 +00:00
parent ef3a11a62e
commit 929b195b05
+1 -1
View File
@@ -142,7 +142,7 @@ mod tests {
fn create_bare_repo() -> TempDir {
let dir = TempDir::new().unwrap();
let status = StdCommand::new("git")
.args(["init", "--bare"])
.args(["init", "--bare", "--quiet", "--initial-branch=main"])
.arg(dir.path())
.status()
.expect("Failed to run git init");