feat: compare and merge external save conflicts safely

This commit is contained in:
2026-10-29 21:24:29 +08:00
parent 00eadf0527
commit 7355cad156
5 changed files with 177 additions and 2 deletions
+3 -1
View File
@@ -137,7 +137,9 @@ def test_save_as_changes_draft_ownership_only_after_success(editing, monkeypatch
assert original.read_text() == "# Original"
def test_save_recreates_externally_deleted_file(editing):
def test_save_recreates_externally_deleted_file(editing, monkeypatch):
from mdhelper import save_conflict
monkeypatch.setattr(save_conflict, "resolve_save_conflict", lambda parent, path, source, *args, **kwargs: source)
window, editor, path = editing
editor.replace_source_undoable("recovered")
path.unlink()