| ... | ... | @@ -428,6 +428,11 @@ pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff { |
| 428 | 428 | blk: while (true) { |
| 429 | 429 | while (lineiter.next()) |lin| { |
| 430 | 430 | if (std.mem.startsWith(u8, lin, "index")) break; |
| 431 | if (std.mem.startsWith(u8, lin, "new file mode")) continue; |
| 432 | if (std.mem.startsWith(u8, lin, "deleted file mode")) continue; |
| 433 | |
| 434 | std.log.err("{s}", .{lin}); |
| 435 | unreachable; |
| 431 | 436 | } |
| 432 | 437 | |
| 433 | 438 | const before_path_raw = lineiter.next().?; |
| ... | ... | @@ -440,10 +445,10 @@ pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff { |
| 440 | 445 | _ = lineiter.index orelse break :blk; |
| 441 | 446 | continue :blk; |
| 442 | 447 | } |
| 443 | | const before_path = extras.trimPrefixEnsure(before_path_raw, "--- a/") orelse extras.trimPrefixEnsure(before_path_raw, "--- ").?; |
| 448 | const before_path = extras.trimPrefixEnsure(before_path_raw, "--- a/") orelse extras.trimPrefixEnsure(before_path_raw, "--- ") orelse @panic(before_path_raw); |
| 444 | 449 | |
| 445 | 450 | const after_path_raw = lineiter.next().?; |
| 446 | | const after_path = extras.trimPrefixEnsure(after_path_raw, "+++ b/") orelse extras.trimPrefixEnsure(after_path_raw, "+++ ").?; |
| 451 | const after_path = extras.trimPrefixEnsure(after_path_raw, "+++ b/") orelse extras.trimPrefixEnsure(after_path_raw, "+++ ") orelse @panic(after_path_raw); |
| 447 | 452 | |
| 448 | 453 | const start_index = lineiter.index.?; |
| 449 | 454 | |