file_write: ensure newline before closing diff fence

This commit is contained in:
Ollie Agent 2026-07-21 15:03:52 +02:00
parent ae37c322cb
commit 2f61f0ce3d
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,8 @@ def format_diff(path, old, new):
diff = ''.join(difflib.unified_diff(old_lines, new_lines, fromfile=path, tofile=path))
if not diff:
return None
if not diff.endswith('\n'):
diff += '\n'
return f"```diff\n{diff}```"
if len(sys.argv) < 3: