╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────╮ │src/test/event.zig│ ╰──────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │90 │ │91 var arena = std.heap.ArenaAllocator.init(allocator); │ │92 defer arena.deinit(); │ │93 + │ │94 + var first_oid: [hash.byteLen(repo_opts.hash)]u8 = undefined; │ │95 │ │96 { │ │97 var json: std.Io.Writer.Allocating = .init(std.testing.allocator);│ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │ 98 defer json.deinit(); │ │ 99 │ │ 98 - for (events_to_consume) |event| { │ │100 + for (events_to_consume, 0..) |event, i| { │ │101 json.clearRetainingCapacity(); │ │102 │ │103 try std.json.Stringify.value(event, .{}, &json.writer);│ ╰────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │104 │ │105 // commit the event into a special branch │ │104 - _ = try repo.commitAtRef(io, allocator, .{ .message = json.written() }, null, .{ .kind = .head, .name = "haxy/meta" }); │ │106 + const oid = try repo.commitAtRef(io, allocator, .{ .message = json.written() }, null, .{ .kind = .head, .name = "haxy/meta" });│ │107 + if (i == 0) { │ │108 + _ = try std.fmt.hexToBytes(&first_oid, &oid); │ │109 + } │ │110 } │ │111 } │ │112 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │108 - // │ │109 - // read and parse all of the events from the repo │ │113 // │ │111 - │ │112 - const events = try readEventsFromRepo(Repo, repo_opts.hash, io, &arena, &repo, "haxy/meta");│ │113 - │ │114 - const first_oid = events[events.len - 1].oid; │ │115 - │ │116 - // │ │114 // consume events into the database │ │115 // │ │116 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │117 { │ │121 - try evt.consume(repo_opts, io, allocator, &repo, events); │ │118 + try evt.consume(repo_opts, io, allocator, &repo, .{ .kind = .head, .name = "haxy/meta" }); │ │119 │ │120 const history = try Repo.DB.ArrayList(.read_only).init(repo.core.db.rootCursor().readOnly());│ │121 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │192 } │ │193 │ │194 // │ │198 - // read and parse all of the events from the repo │ │199 - // │ │200 - │ │201 - const events2 = try readEventsFromRepo(Repo, repo_opts.hash, io, &arena, &repo, "haxy/meta");│ │202 - │ │203 - // │ │195 // consume events into the database │ │196 // │ │197 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │198 { │ │208 - try evt.consume(repo_opts, io, allocator, &repo, events2); │ │199 + try evt.consume(repo_opts, io, allocator, &repo, .{ .kind = .head, .name = "haxy/meta" }); │ │200 │ │201 const history = try Repo.DB.ArrayList(.read_only).init(repo.core.db.rootCursor().readOnly());│ │202 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │267 } │ │268 } │ │269 │ │279 - // │ │280 - // read and parse all of the events from the repo │ │270 // │ │282 - │ │283 - const events3 = try readEventsFromRepo(Repo, repo_opts.hash, io, &arena, &repo, "haxy/meta");│ │284 - │ │285 - // │ │271 // consume events into the database │ │272 // │ │273 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │274 { │ │290 - try evt.consume(repo_opts, io, allocator, &repo, events3); │ │275 + try evt.consume(repo_opts, io, allocator, &repo, .{ .kind = .head, .name = "haxy/meta" }); │ │276 │ │277 const history = try Repo.DB.ArrayList(.read_only).init(repo.core.db.rootCursor().readOnly());│ │278 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │377 │ │378 var arena = std.heap.ArenaAllocator.init(allocator); │ │379 defer arena.deinit(); │ │380 + │ │381 + var first_oid: [hash.byteLen(repo_opts.hash)]u8 = undefined; │ │382 │ │383 { │ │384 var json: std.Io.Writer.Allocating = .init(std.testing.allocator);│ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯