mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
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)
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user