Merge pull request #3686 from restic/fix-diff

Fix diff
This commit is contained in:
Alexander Neumann 2022-03-30 07:43:07 +02:00 committed by GitHub
commit f190d2e60e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,7 @@
Bugfix: Fix the diff command
There was a bug in the `diff` command, it would always show files in a removed
directory as added. We've fixed that.
https://github.com/restic/restic/issues/3685
https://github.com/restic/restic/pull/3686

View file

@ -170,7 +170,7 @@ func (c *Comparer) printDir(ctx context.Context, mode string, stats *DiffStat, b
if node.Type == "dir" {
name += "/"
}
c.printChange(NewChange(name, "+"))
c.printChange(NewChange(name, mode))
stats.Add(node)
addBlobs(blobs, node)