(e61619a) Stage a new ticket through write_then_replace like every other write, and bump to 0.32.11
This commit is contained in:
@@ -574,6 +574,12 @@ fn chmod(path: &Path, mode: u32) {
|
||||
/// itself, and it is named with the ticket and the path rather than raised as a bare io
|
||||
/// error. The branch this replaces could not fire at all: the filename carries a fresh
|
||||
/// uuid, and its message claimed the title was taken.
|
||||
///
|
||||
/// The add stages through `write_then_replace` like every other write, so the temp
|
||||
/// lives under `.worklane/`, outside the directory the chmod keeps closed, and the
|
||||
/// rename is the step that fails here. Both halves have to be gone afterwards: no half
|
||||
/// ticket in backlog, and no `.wl-*.tmp` beside it, which is what `stray_files` checks
|
||||
/// for a move.
|
||||
#[test]
|
||||
fn add_names_the_ticket_and_the_path_when_the_write_fails() {
|
||||
let temp = TempDir::new().unwrap();
|
||||
@@ -596,6 +602,14 @@ fn add_names_the_ticket_and_the_path_when_the_write_fails() {
|
||||
|
||||
chmod(&backlog, 0o755);
|
||||
assert_eq!(fs::read_dir(&backlog).unwrap().count(), 0);
|
||||
|
||||
let strays: Vec<String> = fs::read_dir(&worklane)
|
||||
.unwrap()
|
||||
.filter_map(|e| e.ok())
|
||||
.map(|e| e.file_name().into_string().unwrap())
|
||||
.filter(|name| name.starts_with(".wl-"))
|
||||
.collect();
|
||||
assert_eq!(strays, Vec::<String>::new(), "the staging file was left behind");
|
||||
}
|
||||
|
||||
/// The board above the project is real and empty, and stays empty: a dangling
|
||||
|
||||
Reference in New Issue
Block a user