authorgravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2024-02-22 17:20:41+01:00
committergravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2024-02-22 17:20:41+01:00
loga5326c5ef81885821d39f843bbe83c6a3aaff170
tree5ad439a449fa89c998aaf418cd920a72579e336a
parentd00faa2407cdeaa058da62f2d95f64f9e7ed6a09

return few previous fixes

Review: https://github.com/ziglang/zig/pull/19032#pullrequestreview-1896251841

1 files changed, 3 insertions(+), 3 deletions(-)

src/Package/Fetch/git.zig+3-3
...@@ -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}
10931093
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 further1095/// This will index all non-delta objects, queue delta objects for further
1096/// processing, and return the pack checksum (which is part of the index1096/// 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);
11181118
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 is1125 // The object header is not included in the pack data but is
1126 // part of the object's ID1126 // 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) {