diff options
| author | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-07 20:11:43 +0200 |
|---|---|---|
| committer | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-07 20:11:43 +0200 |
| commit | 17f5736495ea4a219d70fbef696c1b43bac00128 (patch) | |
| tree | 4bb29058964c54c96baee7e5871373f58c177349 /cmd_linux.go | |
| parent | cb909d856472a65adf08bd2cf1f70481bb6959cd (diff) | |
| download | sourcewatch-17f5736495ea4a219d70fbef696c1b43bac00128.tar.gz sourcewatch-17f5736495ea4a219d70fbef696c1b43bac00128.zip | |
Show file count before initial sync starts
Diffstat (limited to 'cmd_linux.go')
| -rw-r--r-- | cmd_linux.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/cmd_linux.go b/cmd_linux.go index d9d392e..9a4da36 100644 --- a/cmd_linux.go +++ b/cmd_linux.go @@ -180,18 +180,16 @@ func syncFromManifest(remote *Manifest, stack *GitignoreStack) { localManifest := scanLocalDirectory(*dataDir) + // First pass: count what needs syncing + var toSync []string for relPath, remoteMeta := range remote.Files { if isGitDir(relPath) { continue } if stack.IsIgnored(relPath) { - stats.skipped++ continue } - destPath := filepath.Join(*dataDir, relPath) - srcPath := filepath.Join(*hostDir, relPath) - if localMeta, exists := localManifest.Files[relPath]; exists { if localMeta.Size == remoteMeta.Size && localMeta.Mode == remoteMeta.Mode && @@ -201,6 +199,15 @@ func syncFromManifest(remote *Manifest, stack *GitignoreStack) { } } + toSync = append(toSync, relPath) + } + logInfo("manifest: %d files to sync", len(toSync)) + + // Second pass: sync + for _, relPath := range toSync { + destPath := filepath.Join(*dataDir, relPath) + srcPath := filepath.Join(*hostDir, relPath) + info, err := os.Lstat(srcPath) if err != nil { if os.IsNotExist(err) { |
