Previously, an accidentally empty tonie folder combined with pruning
(the default) would delete every existing chapter on the tonie. Now:
- syncer.BuildPlan detects an empty local folder and returns a
Plan{Skipped: true, SkipReason: ...} instead of computing a diff
- syncer.ApplyPlan is a no-op for a skipped plan (defense in depth)
- Plan.NeedsChanges() reports false for skipped plans
- cmd/toni-sync sync prints "Skipped: <reason>" for such folders and
moves on, regardless of --no-prune
- Added a test covering the skip behavior end-to-end (BuildPlan +
ApplyPlan no-op)
- README documents the safety behavior
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>