╭ changed ────────╮ │src/test/undo.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │17 defer repo.deinit(io, allocator); │ │18 var arena = std.heap.ArenaAllocator.init(allocator); │ │19 defer arena.deinit(); │ │20 - const initial = try Undo.init(opts, &arena, &repo, null, "", null); │ │20 + const initial = try Undo.init(opts, &arena, &repo, null, "", null, .{ .location = .{ .repo = "" } });│ │21 try std.testing.expectEqual(1, initial.count); │ │22 for (0..25) |index| { │ │23 const value = try std.fmt.allocPrint(arena.allocator(), "{d}", .{index}); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │24 try repo.addConfig(io, allocator, .{ .name = "undo.value", .value = value }); │ │25 } │ │26 - const first = try Undo.init(opts, &arena, &repo, null, "", null); │ │26 + const first = try Undo.init(opts, &arena, &repo, null, "", null, .{ .location = .{ .repo = "" } }); │ │27 try std.testing.expectEqual(20, first.items.len); │ │28 try std.testing.expectEqual(25, first.items[0].index); │ │29 - const second = try Undo.init(opts, &arena, &repo, null, "", first.next); │ │29 + const second = try Undo.init(opts, &arena, &repo, null, "", first.next, .{ .location = .{ .repo = "" } });│ │30 try std.testing.expectEqual(6, second.items.len); │ │31 try std.testing.expectEqual(5, second.items[0].index); │ │32 try std.testing.expectEqual(0, second.items[5].index); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │33 try std.testing.expectEqual(null, second.next); │ │34 - try std.testing.expectError(error.NotFound, Undo.init(opts, &arena, &repo, null, "", 26)); │ │34 + try std.testing.expectError(error.NotFound, Undo.init(opts, &arena, &repo, null, "", 26, .{ .location = .{ .repo = "" } }));│ │35 try std.testing.expectError(error.InvalidHistoryIndex, repo.undo(io, 0)); │ │36 try std.testing.expectError(error.InvalidHistoryIndex, repo.undo(io, 26)); │ │37 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │40 try expectConfig(&repo, "23"); │ │41 try repo.undo(io, 10); │ │42 try expectConfig(&repo, "8"); │ │43 - const undone = try Undo.init(opts, &arena, &repo, null, "", null); │ │43 + const undone = try Undo.init(opts, &arena, &repo, null, "", null, .{ .location = .{ .repo = "" } });│ │44 try std.testing.expectEqual(28, undone.count); │ │45 try std.testing.expectEqualStrings("undo", undone.items[0].action); │ │46 try repo.undo(io, undone.items[0].index); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 96 session.data.current_page = files; │ │ 97 const page = try ui.Repo.init(&arena, &session, files); │ │ 98 try std.testing.expectEqual(allowed, page.undo != null); │ │ 99 - if (page.undo) |undo| try std.testing.expectEqual(user != null and std.mem.eql(u8, user.?, &owner), undo.can_undo); │ │ 99 + if (page.undo) |undo| try std.testing.expectEqual(user != null and std.mem.eql(u8, user.?, &owner), undo.handle.canUndo());│ │100 var root = ui.Widget{ .repo = try ui.Repo.View.init(allocator, &page, &session) }; │ │101 defer root.deinit(allocator); │ │102 try root.build(allocator, constraint, root.getFocus()); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │122 var repo = try xit.repo.Repo(.xit, .{}).open(io, allocator, .{ .path = path }); │ │123 defer repo.deinit(io, allocator); │ │124 try expectConfig(&repo, "first"); │ │125 - const data = try Undo.init(.{}, &arena, &repo, null, "alice/demo", null); │ │125 + const data = try Undo.init(.{}, &arena, &repo, null, "alice/demo", null, .{ .location = .{ .repo = "" } });│ │126 try std.testing.expectEqualStrings("undo", data.items[0].action); │ │127 } │ │128 // keep the old session/page moment, but transfer ownership to the writer. │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │184 var repo = try xit.repo.Repo(.xit, opts).init(io, allocator, .{ .path = path }); │ │185 defer repo.deinit(io, allocator); │ │186 _ = try repo.commitAtRef(io, allocator, .{ .message = "example commit" }, null, .{ .kind = .head, .name = "master" });│ │187 - const data = try Undo.init(opts, &arena, &repo, null, "", null); │ │187 + const data = try Undo.init(opts, &arena, &repo, null, "", null, .{ .location = .{ .repo = "" } }); │ │188 try std.testing.expect(std.mem.startsWith(u8, data.items[0].description, "commit -m \"example commit\"")); │ │189 } │ │190 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯