You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If part of a diff doesn't end in a newline (such as a file not ending in a newline) then the generated patch in load_large_diff might mash two lines together into one line.
Example:
patch = load_large_diff("test.py",
"""\
old content 1
some new content
another line
""",
"""
old content 1
old content 2""")
print(patch)
output (observe the line -old content 2+some new content):
---
+++
@@ -1,3 +1,3 @@
-
old content 1
-old content 2+some new content
+another line
The text was updated successfully, but these errors were encountered:
MarkRx
changed the title
load_large_diff generates incorrect diff if old file does not end in a newline
load_large_diff generates incorrect patch if old file does not end in a newline
Jan 3, 2025
If part of a diff doesn't end in a newline (such as a file not ending in a newline) then the generated patch in load_large_diff might mash two lines together into one line.
Example:
output (observe the line
-old content 2+some new content
):The text was updated successfully, but these errors were encountered: