From a62e42b9be8402301631c9043f640eb7f43eff29 Mon Sep 17 00:00:00 2001 From: Bernhard Guillon Date: Tue, 7 Jul 2026 23:17:20 +0200 Subject: Add FNV-1a content hash to detect same-size changes --- watcher.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'watcher.go') diff --git a/watcher.go b/watcher.go index 137bb36..284c3fa 100644 --- a/watcher.go +++ b/watcher.go @@ -99,7 +99,8 @@ func syncWrite(srcPath, destPath, relPath string, manifest *Manifest, dryRun boo } meta, exists := manifest.Files[relPath] - if exists && meta.Size == info.Size() && meta.Symlink == linkTarget { + srcHash := hashFile(srcPath) + if exists && meta.Size == info.Size() && meta.Symlink == linkTarget && (srcHash == 0 || meta.Hash == srcHash) { return } @@ -108,6 +109,7 @@ func syncWrite(srcPath, destPath, relPath string, manifest *Manifest, dryRun boo Mode: info.Mode(), ModTime: info.ModTime(), Symlink: linkTarget, + Hash: srcHash, } if dryRun { -- cgit v1.2.3