mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
The previous conflict guard lumped symlinks and directories together and os.RemoveAll'd both unconditionally, so a real directory sitting at a generated output path (e.g. a.toml/keep.txt) was silently deleted during `sync extras` even without --force — more destructive than the copy/merge path, where syncOneExtraFile only auto-replaces symlinks. Transform conflict handling now mirrors copy semantics exactly: - symlink → auto-replace (os.Remove, link only) - directory→ skip unless --force; with --force, replace wholesale (os.RemoveAll) - file → idempotent if identical, else skip unless --force Also fix the real deleter: pruneExtraOrphans descended into a skipped conflict directory and pruned its contents as orphans. It now SkipDirs any directory occupying a claimed output path, leaving it fully untouched. Adds regression tests for the directory-conflict skip and the forced replacement.