diff options
| -rw-r--r-- | git.zig | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -30,6 +30,14 @@ const Object = struct { // pub fn getBlob(self: *Object) Blob {} }; +fn decompress(alloc: Alloc, r: Reader) ![]u8 { + var buffer = std.ArrayList(u8).init(alloc); + + try std.compress.zlib.decompress(r, buffer.writer().any()); + + return alloc.realloc(buffer.allocatedSlice(), buffer.items.len); +} + const PackFile = struct { alloc: Alloc, idxFile: std.fs.File, |
