Skip to content

Commit

Permalink
Fix for when diff has "No newline at end of file"
Browse files Browse the repository at this point in the history
These lines are sort of separate from the diff somehow? But shouldn't
be included in the lookup table anyway
  • Loading branch information
ZedThree committed Apr 22, 2021
1 parent bba1a48 commit 3677b43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions review.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def make_file_line_lookup(diff):
lookup[filename] = {}
for hunk in file:
for line in hunk:
if line.diff_line_no is None:
continue
if not line.is_removed:
lookup[filename][line.target_line_no] = (
line.diff_line_no - DIFF_HEADER_LINE_LENGTH
Expand Down

0 comments on commit 3677b43

Please sign in to comment.