Files
restic/changelog/unreleased/issue-22181
T
Dean Chen 4dfa381b9f restorer: don't delete files when a directory tree can't be loaded (#22189)
When loading or iterating a directory tree failed, traverseTreeInner
returned a nil file list together with the error. If the error handler
ignored the error, the caller still called leaveDir with that nil list,
and restore --delete removed every existing entry of the directory in
the target, even though the expected content was simply unknown.

Force disable deletion in that case, the same way it is already done
for invalid node names.

Signed-off-by: Dean Chen <862469039@qq.com>
2026-11-15 19:50:17 +01:00

9 lines
419 B
Plaintext

Bugfix: Do not delete files in directories whose tree cannot be loaded
When `restore --delete` failed to load or read the tree of a directory, for
example because a pack file was missing, restic reported an error but then
deleted all existing content of that directory in the target. Restic now
disables deletion for the rest of the restore when a tree cannot be loaded.
https://github.com/restic/restic/issues/22181