Skip to content

Commit

Permalink
fix: diffs on files without a newline at the end are displayed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
redimp committed Oct 6, 2024
1 parent 346ed7c commit 561ed88
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions otterwiki/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def patchset2filedict(patchset):
" ": "",
"+": "added",
"-": "removed",
"\\": "", # line.line_type='\\' line.value=' No newline at end of file\n'
}
files = {}
for file in patchset:
Expand All @@ -169,6 +170,7 @@ def patchset2filedict(patchset):
}
)
for line in hunk:
print(f"{line=} {line.line_type=} {line.value=}")
line_data.append(
{
"source": line.source_line_no or "",
Expand Down

0 comments on commit 561ed88

Please sign in to comment.