From 9d4ac34f4b64f17ce2ea415f9b0a13f386ee491c Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Thu, 6 Jun 2019 12:35:34 -0400 Subject: [PATCH] Don't compare hashes of empty files in the diff command Empty files may or may not have a hash depending if the -hash option is used during backup. --- src/duplicacy_snapshotmanager.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/duplicacy_snapshotmanager.go b/src/duplicacy_snapshotmanager.go index 383990a..e4e6c6f 100644 --- a/src/duplicacy_snapshotmanager.go +++ b/src/duplicacy_snapshotmanager.go @@ -1482,7 +1482,11 @@ func (manager *SnapshotManager) Diff(top string, snapshotID string, revisions [] same = right.IsSameAs(left) } } else { - same = left.Hash == right.Hash + if left.Size == 0 && right.Size == 0 { + same = true + } else { + same = left.Hash == right.Hash + } } if !same {