check: make check command obey --dry-run/-i/--interactive - fixes #4325

This commit is contained in:
Nick Craig-Wood 2020-06-10 12:48:03 +01:00
parent 5866b1b017
commit 63cf0b1cdd

View File

@ -830,6 +830,9 @@ func (c *checkMarch) Match(ctx context.Context, dst, src fs.DirEntry) (recurse b
case fs.Object:
dstX, ok := dst.(fs.Object)
if ok {
if SkipDestructive(ctx, src, "check") {
return false
}
differ, noHash := c.checkIdentical(ctx, dstX, srcX)
if differ {
atomic.AddInt32(&c.differences, 1)