diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-24 14:33:21 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-24 14:33:21 -0500 |
| commit | 5c0fa15d1d5bbe48f85f21e98bb6e91e9b9bcd85 (patch) | |
| tree | 684a3e9da41d1587e36732a6aee8502bd7aaa5a9 /tests/test-undead-buffers-make-buffer-undead.el | |
| parent | c858c74aa09667fbf899f587be816e8ad5e20d55 (diff) | |
| download | dotemacs-5c0fa15d1d5bbe48f85f21e98bb6e91e9b9bcd85.tar.gz dotemacs-5c0fa15d1d5bbe48f85f21e98bb6e91e9b9bcd85.zip | |
fix(org-roam): guard move-branch-to-roam against data loss
cj/move-org-branch-to-roam cut the subtree from the source buffer before writing the new roam file, so a failure in the demote/format/write/db-sync steps left the subtree gone from the source and not persisted anywhere — a destructive operation with no rollback.
Reordered so the node file is written and verified on disk before org-cut-subtree runs; a failed write now aborts with the source untouched. Added a no-clobber guard (refuse an existing target file) and a confirmation prompt for large subtrees (>= cj/move-org-branch-confirm-lines, 30) or buffers with unsaved changes. The source buffer is deliberately left modified and undoable rather than auto-saved, so the move stays reversible. New test drives the write-failure-preserves-source invariant via an unwritable roam dir; the existing creates-roam-file test gained the confirm mock.
Diffstat (limited to 'tests/test-undead-buffers-make-buffer-undead.el')
0 files changed, 0 insertions, 0 deletions
