mirror of
https://github.com/octoleo/restic.git
synced 2024-11-21 20:35:12 +00:00
diff: copy nodes before modifying them for bitrot detection
This commit is contained in:
parent
a7dc18e697
commit
3549635243
@ -274,11 +274,13 @@ func (c *Comparer) diffTree(ctx context.Context, stats *DiffStatsContainer, pref
|
||||
mod += "M"
|
||||
stats.ChangedFiles++
|
||||
|
||||
node1NilContent := node1
|
||||
node2NilContent := node2
|
||||
node1NilContent := *node1
|
||||
node2NilContent := *node2
|
||||
node1NilContent.Content = nil
|
||||
node2NilContent.Content = nil
|
||||
if node1NilContent.Equals(*node2NilContent) {
|
||||
// the bitrot detection may not work if `backup --ignore-inode` or `--ignore-ctime` were used
|
||||
if node1NilContent.Equals(node2NilContent) {
|
||||
// probable bitrot detected
|
||||
mod += "?"
|
||||
}
|
||||
} else if c.opts.ShowMetadata && !node1.Equals(*node2) {
|
||||
|
Loading…
Reference in New Issue
Block a user