diff options
| author | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-07 23:17:20 +0200 |
|---|---|---|
| committer | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-07 23:17:20 +0200 |
| commit | a62e42b9be8402301631c9043f640eb7f43eff29 (patch) | |
| tree | d85b47ba88a15d9aa7a109c1cd6426ba9faee4f5 /cmd_linux.go | |
| parent | 2850cd0c3156cdeb42594664cc087641fe740236 (diff) | |
| download | sourcewatch-main.tar.gz sourcewatch-main.zip | |
Diffstat (limited to 'cmd_linux.go')
| -rw-r--r-- | cmd_linux.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd_linux.go b/cmd_linux.go index 305b7d1..70ee2fb 100644 --- a/cmd_linux.go +++ b/cmd_linux.go @@ -194,13 +194,15 @@ func syncFromManifest(remote *Manifest, stack *GitignoreStack) { if localMeta, exists := localManifest.Files[relPath]; exists { if localMeta.Size == remoteMeta.Size && - localMeta.Symlink == remoteMeta.Symlink { + localMeta.Symlink == remoteMeta.Symlink && + (remoteMeta.Hash == 0 || localMeta.Hash == remoteMeta.Hash) { continue } if debugShown < 5 { - logDebug("mismatch %s: size=%d/%d symlink=%q/%q", + logDebug("mismatch %s: size=%d/%d hash=%d/%d symlink=%q/%q", relPath, localMeta.Size, remoteMeta.Size, + localMeta.Hash, remoteMeta.Hash, localMeta.Symlink, remoteMeta.Symlink) debugShown++ } @@ -310,11 +312,17 @@ func scanLocalDirectory(root string) *Manifest { linkTarget, _ = os.Readlink(path) } + var hash uint64 + if !info.IsDir() && linkTarget == "" { + hash = hashFile(path) + } + manifest.Files[relPath] = FileMeta{ Size: info.Size(), Mode: info.Mode(), ModTime: info.ModTime(), Symlink: linkTarget, + Hash: hash, } return nil |
