From ef3a11a62e32644215d95b333fdf36317da10545 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 10 Sep 2026 08:46:04 +0000 Subject: [PATCH 1/2] test(migration): initialize shallow origin on main The shallow-backup fixture populated refs/heads/main but left the bare repository HEAD on Git's configurable default branch. In clean Nix builds that default is master, so clone succeeded as an empty repository and never wrote the shallow marker the test requires. Initialize the fixture explicitly on main so HEAD names the populated branch and the depth-one clone deterministically exercises shallow migration behavior. Production migration code is unchanged. Validation: cargo fmt --check; cargo test -p ngit-grasp --lib shallow_legacy_backup_waits_for_family_closure. Assisted-by: Codex (GPT-5) --- src/git/migration.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/git/migration.rs b/src/git/migration.rs index 0b7126f..79bf168 100644 --- a/src/git/migration.rs +++ b/src/git/migration.rs @@ -2172,7 +2172,13 @@ mod tests { let origin = temp.path().join("origin.git"); git( temp.path(), - &["init", "--bare", "--quiet", origin.to_str().unwrap()], + &[ + "init", + "--bare", + "--quiet", + "--initial-branch=main", + origin.to_str().unwrap(), + ], ); let parent = write_commit_object(&origin, None); let child = write_commit_object(&origin, Some(&parent)); From 929b195b054e56081d48ca2348282bc208335505 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 10 Sep 2026 10:03:02 +0000 Subject: [PATCH 2/2] 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) --- src/git/subprocess.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git/subprocess.rs b/src/git/subprocess.rs index 1dc9c4e..54f9f9e 100644 --- a/src/git/subprocess.rs +++ b/src/git/subprocess.rs @@ -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");