From 91a654101d87c05a9fe530ce4fad80fac5b7d710 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sat, 21 Nov 2026 12:44:36 -0700 Subject: [PATCH] test(cli): the owner removes every lock the words name, the HEAD lock too A push to a bare folder repository locks HEAD as well as the branch when it moves the branch HEAD names. Both locks are left when git is killed, and the server names both. A newer git (Linux) goes on past a stale HEAD.lock, an older one (macOS) refuses the push with "cannot lock ref 'HEAD'"; the test removed only main.lock, so the last backup failed on macOS. The test now removes each lock the report names (and asserts each is named), as the words tell the owner; the program already reported both. Co-Authored-By: Claude Fable 5.2 --- crates/ledger-cli/tests/book_open_close.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/ledger-cli/tests/book_open_close.rs b/crates/ledger-cli/tests/book_open_close.rs index 103874de..06c9d2b4 100644 --- a/crates/ledger-cli/tests/book_open_close.rs +++ b/crates/ledger-cli/tests/book_open_close.rs @@ -3735,8 +3735,13 @@ fn a_lock_a_kill_leaves_in_the_backup_folder_is_reported_and_never_removed_by_th } other => panic!("{other:?}"), } - assert!(lock.exists(), "a later backup removed it"); - std::fs::remove_file(&lock).unwrap(); + assert!( + left.iter().all(|f| f.exists()), + "a later backup removed one of {left:?}" + ); + for file in &left { + std::fs::remove_file(file).unwrap(); + } match home.admin(Request::BackUpNow { id: A.into(), new_disk: false,