fix(atomic): the vanished-backup error names the path it looked at

This commit is contained in:
Hartmut Nörenberg committed 2026-11-04 01:13:43 +01:00
1 parent 30c617cc79
commit 82ee6ada2e
2 files changed
+6 -4

No files matched your search

+4 -3
View File
@@ -511,9 +511,10 @@ pub(crate) fn unresolved_recovery_error(dest: &Path, completion: &io::Error, res
let msg = if restoration.kind() == io::ErrorKind::NotFound {
format!(
"cannot save {}: the previous version moved to its backup name but {RECOVERY_UNRESOLVED} from it \
(completing the save failed: {completion}; the backup no longer exists: {restoration}), \
so the destination currently holds no file under that name",
dest.display()
(completing the save failed: {completion}; the backup {} no longer exists: {restoration}), \
so the destination currently holds no file under that name — check whether it was moved",
dest.display(),
recovery.display()
)
} else {
format!(
+2 -1
View File
@@ -384,7 +384,8 @@ fn a_vanished_backup_is_reported_as_gone_rather_than_as_a_recovery_copy() {
Path::new("/docs/.report.psd.9.pcsave.tmp"),
);
let msg = e.to_string();
assert!(msg.contains("no longer exists") && msg.contains("no file under that name"), "{msg}");
assert!(msg.contains(".report.psd.9.pcsave.tmp") && msg.contains("no longer exists"), "the vanished backup is named: {msg}");
assert!(msg.contains("no file under that name"), "{msg}");
assert!(!msg.contains("survives at"), "no recovery promise for a vanished backup: {msg}");
assert!(!msg.contains("the original file was not changed"), "{msg}");
}