From ef3a11a62e32644215d95b333fdf36317da10545 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 10 Sep 2026 08:46:04 +0000 Subject: [PATCH] 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));