}
}
}
+
+test "basic frontend" {
+ const alloc = std.testing.allocator;
+ var repo = try Repo.open(alloc, "../imgui/.git");
+ defer repo.close();
+
+ const head = try repo.getHead();
+
+ var id = head;
+
+ for (0..3) |_| {
+ if (try repo.getObject(id)) |o| {
+ defer alloc.free(o.data);
+
+ switch (try o.parse(alloc)) {
+ .c => |c| {
+ std.debug.print("commit {x}:\n tree: {x}\n parent: {x}\n author: {s}\n committer: {s}\n message: {s}\n", .{ id, c.tree, c.parent, c.author, c.committer, c.message });
+ id = c.parent;
+ },
+ else => {},
+ }
+ }
+ }
+}