diff options
| author | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-07 23:12:53 +0200 |
|---|---|---|
| committer | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-07 23:12:53 +0200 |
| commit | 2850cd0c3156cdeb42594664cc087641fe740236 (patch) | |
| tree | ed8189345675087d0a7da9546d68dc9b4a0806d9 | |
| parent | 4cb0b6cde565291bee4c7d094ea0d0d7fa4f26ce (diff) | |
| download | sourcewatch-2850cd0c3156cdeb42594664cc087641fe740236.tar.gz sourcewatch-2850cd0c3156cdeb42594664cc087641fe740236.zip | |
Compare only size+symlink for sync — mode and modtime are unreliable across NTFS→Docker volume
| -rw-r--r-- | cmd_linux.go | 6 | ||||
| -rw-r--r-- | watcher.go | 10 |
2 files changed, 6 insertions, 10 deletions
diff --git a/cmd_linux.go b/cmd_linux.go index 390e431..305b7d1 100644 --- a/cmd_linux.go +++ b/cmd_linux.go @@ -194,17 +194,13 @@ func syncFromManifest(remote *Manifest, stack *GitignoreStack) { if localMeta, exists := localManifest.Files[relPath]; exists { if localMeta.Size == remoteMeta.Size && - localMeta.Mode == remoteMeta.Mode && - localMeta.ModTime.Equal(remoteMeta.ModTime) && localMeta.Symlink == remoteMeta.Symlink { continue } if debugShown < 5 { - logDebug("mismatch %s: size=%d/%d mode=%o/%o modtime=%v/%v symlink=%q/%q", + logDebug("mismatch %s: size=%d/%d symlink=%q/%q", relPath, localMeta.Size, remoteMeta.Size, - localMeta.Mode, remoteMeta.Mode, - localMeta.ModTime, remoteMeta.ModTime, localMeta.Symlink, remoteMeta.Symlink) debugShown++ } @@ -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(), |
