| ... | @@ -363,7 +363,7 @@ pub fn parseTreeDiffMeta(input: string) !TreeDiffMeta { | ... | @@ -363,7 +363,7 @@ pub fn parseTreeDiffMeta(input: string) !TreeDiffMeta { |
| 363 | result.files_changed += 1; | 363 | result.files_changed += 1; |
| 364 | } | 364 | } |
| 365 | | 365 | |
| 366 | std.debug.assert(std.mem.startsWith(u8, lineiter.next().?, "diff --git")); | 366 | std.debug.assert(std.mem.startsWith(u8, lineiter.next() orelse return result, "diff --git")); |
| 367 | blk: while (true) { | 367 | blk: while (true) { |
| 368 | while (lineiter.next()) |lin| { | 368 | while (lineiter.next()) |lin| { |
| 369 | if (std.mem.startsWith(u8, lin, "index")) break; | 369 | if (std.mem.startsWith(u8, lin, "index")) break; |
| ... | @@ -467,7 +467,7 @@ pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff { | ... | @@ -467,7 +467,7 @@ pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff { |
| 467 | // freedesktop/xorg/libxmu | 467 | // freedesktop/xorg/libxmu |
| 468 | // ncompress | 468 | // ncompress |
| 469 | // +freedesktop/xorg/libxpm | 469 | // +freedesktop/xorg/libxpm |
| 470 | std.debug.assert(std.mem.startsWith(u8, lineiter.next().?, "diff --git")); | 470 | std.debug.assert(std.mem.startsWith(u8, lineiter.next() orelse return std.mem.zeroes(TreeDiff), "diff --git")); |
| 471 | blk: while (true) { | 471 | blk: while (true) { |
| 472 | while (lineiter.next()) |lin| { | 472 | while (lineiter.next()) |lin| { |
| 473 | if (std.mem.startsWith(u8, lin, "index")) break; | 473 | if (std.mem.startsWith(u8, lin, "index")) break; |