╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────╮ │157 attachments: []const Attachment.WithId = &.{},│ │158 draft: bool = false, │ │159 revision_oid: []const u8 = "", │ │160 + commit_count: ?u64 = null, │ │161 no_changes: bool = false, │ │162 fork_exists: bool = false, │ │163 mergeability: pch.Mergeability = .{}, │ ╰───────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │257 │ │258 pub fn listRoute(identity: []const u8, status: Status, tag: []const u8, selected: []const u8) ?ui.RoutablePage {│ │259 return ui.RoutablePage.repoPatchesRoute(identity, status, tag, selected); │ │259 -} │ │260 - │ │261 -pub fn forkRoute(identity: []const u8, id: []const u8) ?ui.RoutablePage { │ │262 - return ui.RoutablePage.forkPatchRoute(identity, id); │ │260 } │ │261 │ │262 pub fn draftsRoute(identity: []const u8) ?ui.RoutablePage { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │738 } │ │739 const target_branch = item.record.event.target_branch; │ │740 const revision = item.record.event.revision orelse continue;│ │741 + item.commit_count = revision.commit_count; │ │742 item.revision_oid = switch (item.record.event.status) { │ │743 .merged => |oid| oid, │ │744 else => revision.source_oid, │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │844 const patch = (try evt.Patch.readById(evt.EventDB(.sha1), .sha1, moment, arena, &id)) orelse return null; │ │845 const target_branch = patch.event.target_branch; │ │846 const target_oid = try target_repo.readRef(io, .{ .kind = .head, .name = target_branch }); │ │847 + const commit_count: ?u64 = blk: { │ │848 + const newest = evt.PatchRev.readNewest(evt.EventDB(.sha1), .sha1, moment, arena) catch break :blk null;│ │849 + break :blk if (newest) |revision| revision.record.commit_count else 0; │ │850 + }; │ │851 return .{ │ │852 .id = try aa.dupe(u8, &id_hex), │ │853 .record = patch, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │854 .author = try ui.Author.initFromEmail(admin_moment, arena, patch.author_email), │ │855 .draft = true, │ │856 .revision_oid = try aa.dupe(u8, &fork_oid), │ │857 + .commit_count = commit_count, │ │858 .no_changes = if (target_oid) |oid| std.mem.eql(u8, &oid, &fork_oid) else false,│ │859 .fork_exists = true, │ │860 }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯