╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │50 // didn't name one), so the page can canonicalize its url to it. │ │51 ref_or_oid: ui.RoutablePage.RefOrOid, │ │52 ref_or_oid_value: []const u8, │ │53 +commit_count: ?u64 = null, │ │54 commits: []const Commit, │ │55 // the first oid of the next page, or null when this is the last page.│ │56 next_start: ?[]const u8, │ ╰──────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │171 } │ │172 } │ │173 │ │174 + const commit_count: ?u64 = switch (repo_kind) { │ │175 + .git => null, │ │176 + .xit => blk: { │ │177 + const head_count = repo.commitCount(io, gpa, .{ .oid = &resolved.oid }) catch break :blk null;│ │178 + const base_oid = base_oid_maybe orelse break :blk head_count; │ │179 + const base_count = repo.commitCount(io, gpa, .{ .oid = &base_oid }) catch break :blk null; │ │180 + break :blk if (head_count >= base_count) head_count - base_count else null; │ │181 + }, │ │182 + }; │ │183 + │ │184 return .{ │ │185 .location = try location.dupe(aa), │ │186 .ref_or_oid = resolved.ref_or_oid, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────╮ │187 .ref_or_oid_value = resolved.value, │ │188 + .commit_count = commit_count, │ │189 .commits = try aa.dupe(Commit, buf[0..count]),│ │190 .next_start = next_start, │ │191 .content = try pageContent(aa, content), │ ╰───────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │199 .location = try location.dupe(aa), │ │200 .ref_or_oid = ref_or_oid, │ │201 .ref_or_oid_value = try aa.dupe(u8, value),│ │202 + .commit_count = null, │ │203 .commits = &.{}, │ │204 .next_start = null, │ │205 .content = try pageContent(aa, content), │ ╰────────────────────────────────────────────────────────╯