| ... | @@ -1091,7 +1091,7 @@ pub fn indexPack(allocator: Allocator, pack: std.fs.File, index_writer: anytype) | ... | @@ -1091,7 +1091,7 @@ pub fn indexPack(allocator: Allocator, pack: std.fs.File, index_writer: anytype) |
| 1091 | try index_writer.writeAll(&index_checksum); | 1091 | try index_writer.writeAll(&index_checksum); |
| 1092 | } | 1092 | } |
| 1093 | | 1093 | |
| 1094 | // Performs the first pass over the packfile data for index construction. | 1094 | /// Performs the first pass over the packfile data for index construction. |
| 1095 | /// This will index all non-delta objects, queue delta objects for further | 1095 | /// This will index all non-delta objects, queue delta objects for further |
| 1096 | /// processing, and return the pack checksum (which is part of the index | 1096 | /// processing, and return the pack checksum (which is part of the index |
| 1097 | /// format). | 1097 | /// format). |
| ... | @@ -1117,14 +1117,14 @@ fn indexPackFirstPass( | ... | @@ -1117,14 +1117,14 @@ fn indexPackFirstPass( |
| 1117 | const entry_header = try EntryHeader.read(pack_reader); | 1117 | const entry_header = try EntryHeader.read(pack_reader); |
| 1118 | | 1118 | |
| 1119 | switch (entry_header) { | 1119 | switch (entry_header) { |
| 1120 | inline .commit, .tree, .blob, .tag => |object, tag| { | 1120 | .commit, .tree, .blob, .tag => |object| { |
| 1121 | var entry_decompress_stream = std.compress.zlib.decompressor(pack_reader); | 1121 | var entry_decompress_stream = std.compress.zlib.decompressor(pack_reader); |
| 1122 | var entry_counting_reader = std.io.countingReader(entry_decompress_stream.reader()); | 1122 | var entry_counting_reader = std.io.countingReader(entry_decompress_stream.reader()); |
| 1123 | var entry_hashed_writer = hashedWriter(std.io.null_writer, Sha1.init(.{})); | 1123 | var entry_hashed_writer = hashedWriter(std.io.null_writer, Sha1.init(.{})); |
| 1124 | const entry_writer = entry_hashed_writer.writer(); | 1124 | const entry_writer = entry_hashed_writer.writer(); |
| 1125 | // The object header is not included in the pack data but is | 1125 | // The object header is not included in the pack data but is |
| 1126 | // part of the object's ID | 1126 | // part of the object's ID |
| 1127 | try entry_writer.print("{s} {}\x00", .{ @tagName(tag), object.uncompressed_length }); | 1127 | try entry_writer.print("{s} {}\x00", .{ @tagName(entry_header), object.uncompressed_length }); |
| 1128 | var fifo = std.fifo.LinearFifo(u8, .{ .Static = 4096 }).init(); | 1128 | var fifo = std.fifo.LinearFifo(u8, .{ .Static = 4096 }).init(); |
| 1129 | try fifo.pump(entry_counting_reader.reader(), entry_writer); | 1129 | try fifo.pump(entry_counting_reader.reader(), entry_writer); |
| 1130 | if (entry_counting_reader.bytes_read != object.uncompressed_length) { | 1130 | if (entry_counting_reader.bytes_read != object.uncompressed_length) { |