aboutsummaryrefslogtreecommitdiffstats
path: root/watcher.go
diff options
context:
space:
mode:
authorBernhard Guillon <Bernhard.Guillon@begu.org>2026-07-07 23:12:53 +0200
committerBernhard Guillon <Bernhard.Guillon@begu.org>2026-07-07 23:12:53 +0200
commit2850cd0c3156cdeb42594664cc087641fe740236 (patch)
treeed8189345675087d0a7da9546d68dc9b4a0806d9 /watcher.go
parent4cb0b6cde565291bee4c7d094ea0d0d7fa4f26ce (diff)
downloadsourcewatch-2850cd0c3156cdeb42594664cc087641fe740236.tar.gz
sourcewatch-2850cd0c3156cdeb42594664cc087641fe740236.zip
Compare only size+symlink for sync — mode and modtime are unreliable across NTFS→Docker volume
Diffstat (limited to 'watcher.go')
-rw-r--r--watcher.go10
1 files changed, 5 insertions, 5 deletions
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(),