X-Git-Url: https://gitweb.ps.run/ziggit/blobdiff_plain/35b99e92b6d6d478d401f5587930b7a15d6e74e0..93ee72996f9dd80ef2a867a96b207e78a4aad7a2:/git.zig diff --git a/git.zig b/git.zig index e21847c..d228b50 100644 --- a/git.zig +++ b/git.zig @@ -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,