Unified · Split
| @@ -213,7 +213,20 @@ mod baseline { · 212 unmodified lines | ||
| 213 | 213 | hunk_lines.extend_from_slice(line); |
| 214 | 214 | hunk_lines.push(b'\n'); |
| 215 | 215 | } |
| 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 | + ), | |
| 217 | 230 | } |
| 218 | 231 | |
| 219 | 232 | match self.lines.peek() { |