Closes the audit's deferred #18 — the right way this time. An explicit 'devbox restore' no longer silently clobbers UNCOMMITTED local edits: - captureUncommitted reads the bytes of any local file that differs from BOTH the snapshot being restored AND the current hub head (== an edit that was never pushed) BEFORE the restore overwrites/deletes it. - After applySnapshot runs, those bytes are written back as .conflict- <host>-<ts> copies (discoverable via 'devbox conflicts', and they propagate like any conflict copy). The head comparison is the key: a CLEAN restore (no uncommitted edits) captures nothing and reproduces the snapshot exactly — TestRestoreWholeTree still passes. Capture-before / write-after ordering means applySnapshot's delete pass never eats the copy. Refactored the conflict-name probe into a shared freeConflictName. Deploy stays as-is (read-only/pinned mounts have no uncommitted edits to lose). New test: an uncommitted v3 survives a revert to v1 as a conflict copy. 18 pkgs -race green; windows builds. |
||
|---|---|---|
| .. | ||
| chunk | ||
| config | ||
| control | ||
| daemon | ||
| hooks | ||
| hub | ||
| identity | ||
| ignore | ||
| manifest | ||
| secret | ||
| syncer | ||
| transport | ||
| watch | ||