From 2850cd0c3156cdeb42594664cc087641fe740236 Mon Sep 17 00:00:00 2001 From: Bernhard Guillon Date: Tue, 7 Jul 2026 23:12:53 +0200 Subject: =?UTF-8?q?Compare=20only=20size+symlink=20for=20sync=20=E2=80=94?= =?UTF-8?q?=20mode=20and=20modtime=20are=20unreliable=20across=20NTFS?= =?UTF-8?q?=E2=86=92Docker=20volume?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- watcher.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'watcher.go') diff --git a/watcher.go b/watcher.go index 1ee3972..137bb36 100644 --- a/watcher.go +++ b/watcher.go @@ -89,11 +89,6 @@ func syncWrite(srcPath, destPath, relPath string, manifest *Manifest, dryRun boo return } - meta, exists := manifest.Files[relPath] - if exists && meta.Size == info.Size() && meta.Mode == info.Mode() && meta.ModTime.Equal(info.ModTime()) { - return - } - linkTarget := "" if info.Mode()&os.ModeSymlink != 0 { linkTarget, err = os.Readlink(srcPath) @@ -103,6 +98,11 @@ func syncWrite(srcPath, destPath, relPath string, manifest *Manifest, dryRun boo } } + meta, exists := manifest.Files[relPath] + if exists && meta.Size == info.Size() && meta.Symlink == linkTarget { + return + } + manifest.Files[relPath] = FileMeta{ Size: info.Size(), Mode: info.Mode(), -- cgit v1.2.3