const Id = u160;
const Commit = struct {
+ tree: Id,
+ parent: Id,
author: []u8,
+ committer: []u8,
message: []u8,
- parent: Id,
- tree: Id,
};
+const TreeEntry = struct {
+ permissions: []u8,
+ name: []u8,
+ id: Id,
+};
+const Tree = std.ArrayList(TreeEntry);
const Blob = struct {
data: []u8,
};
// 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,