Skip to content

Commit cb66d19

Browse files
committed
Account for "\ No newline at end of file"
1 parent 3e40438 commit cb66d19

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

gix-diff/tests/diff/blob/slider.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,20 @@ mod baseline {
213213
hunk_lines.extend_from_slice(line);
214214
hunk_lines.push(b'\n');
215215
}
216-
_ => unreachable!("BUG: expecting unified diff format"),
216+
b'\\' => {
217+
if line == "\\ No newline at end of file".as_bytes() {
218+
// Do nothing.
219+
} else {
220+
unreachable!(
221+
"BUG: expecting unified diff format, found line: `{}`",
222+
line.to_str_lossy()
223+
)
224+
}
225+
}
226+
_ => unreachable!(
227+
"BUG: expecting unified diff format, found line: `{}`",
228+
line.to_str_lossy()
229+
),
217230
}
218231

219232
match self.lines.peek() {

0 commit comments

Comments
 (0)