╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │13 pub const event_id_size: usize = 32; │ │14 │ │15 // the branch haxy events are committed to before being consumed │ │16 -pub const events_ref: rf.Ref = .{ .kind = .head, .name = "haxy/meta" }; │ │16 +pub const events_ref: rf.Ref = .{ .kind = .head, .name = "haxy/events" }; │ │17 │ │18 // options + db type for *the admin repo* — the single event store that holds│ │19 // users, repos, issues, etc. the functions below stay parameterized over │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────╮ │src/test/event.zig│ ╰──────────────────╯ ╭───────────────────────────────────────╮ │2 const evt = @import("../event.zig");│ │3 const xit = @import("xit"); │ │4 const rp = xit.repo; │ │5 +const rf = xit.ref; │ │6 const hash = xit.hash; │ │7 │ │8 test "rebase" { │ ╰───────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │103 try std.json.Stringify.value(event, .{}, &json.writer); │ │104 │ │105 // commit the event into a special branch │ │105 - const oid = 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, evt.events_ref); │ │107 if (i == 0) { │ │108 _ = try std.fmt.hexToBytes(&first_oid, &oid); │ │109 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │115 // │ │116 │ │117 { │ │117 - try evt.consume(repo_opts, io, allocator, &repo, .{ .kind = .head, .name = "haxy/meta" });│ │118 + try evt.consume(repo_opts, io, allocator, &repo, evt.events_ref); │ │119 │ │120 const haxy_moment = try evt.currentMoment(repo_opts, &repo); │ │121 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │153 }; │ │154 │ │155 // commit and consume the new event │ │155 - try evt.commitAndConsume(repo_opts, io, allocator, &repo, .{ .kind = .head, .name = "haxy/meta" }, &events_to_consume2);│ │156 + try evt.commitAndConsume(repo_opts, io, allocator, &repo, evt.events_ref, &events_to_consume2); │ │157 │ │158 // │ │159 // rebase the branch so it no longer includes the edit event │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │186 .parent_oids = if (i == 0) &.{std.fmt.bytesToHex(first_oid, .lower)} else null,│ │187 }, │ │188 null, │ │188 - .{ .kind = .head, .name = "haxy/meta" }, │ │189 + evt.events_ref, │ │190 ); │ │191 } │ │192 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │196 // │ │197 │ │198 { │ │198 - try evt.consume(repo_opts, io, allocator, &repo, .{ .kind = .head, .name = "haxy/meta" });│ │199 + try evt.consume(repo_opts, io, allocator, &repo, evt.events_ref); │ │200 │ │201 const haxy_moment = try evt.currentMoment(repo_opts, &repo); │ │202 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────╮ │245 .parent_oids = if (i == 0) &.{} else null,│ │246 }, │ │247 null, │ │247 - .{ .kind = .head, .name = "haxy/meta" }, │ │248 + evt.events_ref, │ │249 ); │ │250 } │ │251 } │ ╰───────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │255 // │ │256 │ │257 { │ │257 - try evt.consume(repo_opts, io, allocator, &repo, .{ .kind = .head, .name = "haxy/meta" });│ │258 + try evt.consume(repo_opts, io, allocator, &repo, evt.events_ref); │ │259 │ │260 const haxy_moment = try evt.currentMoment(repo_opts, &repo); │ │261 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │272 const io = std.testing.io; │ │273 const allocator = std.testing.allocator; │ │274 const temp_dir_name = "temp-event-merge"; │ │275 + │ │276 + const other_events_ref: rf.Ref = .{ .kind = .head, .name = "haxy/other" };│ │277 │ │278 // create the temp dir │ │279 const cwd = std.Io.Dir.cwd(); │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯