Stop counting directories and unchanged symlinks as files to back up (closes #305)
check / check (push) Waiting to run

Every backup queued every directory and symlink for the second phase.
The line ending the walk counted directories, and their stat sizes, as
files to back up while its enumerated count left them out, and a
symlink was counted as backed up on every run, its target length as
data.

The walk now sets directories aside: they are recorded before the files
are backed up and are never counted as files or data, and the walk's
progress estimate leaves out the directories the local index knows. A
symlink is checked against its record as a regular file is, its target
included, so an unchanged one counts as unchanged. A test comment that
said directories count toward the backup's total size is corrected.

Judgement call: every directory is still written to the local index on
every backup, as before; no report shows it.

Model: opus-5-5
This commit is contained in:
2026-10-14 04:18:15 +00:00
parent a0de8bfdb7
commit b3cf02c817
5 changed files with 254 additions and 74 deletions
+1 -2
View File
@@ -78,8 +78,7 @@ func TestProgressPercentWithSecondPathSmaller(t *testing.T) {
stats := progress.GetStats()
// Directories count toward the total size but produce no chunks, so
// the percentage ends just under 100%.
// With both paths counted, the percentage must not exceed 100%.
percent := float64(stats.BytesProcessed.Load()) /
float64(stats.TotalSize.Load()) * 100
if percent > 100 {