╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │122 var moment = repo.core.latestMoment() catch return emptyResult(aa, location, resolved.ref_or_oid, resolved.value, content, base_oid);│ │123 const state = rp.Repo(repo_kind, repo_opts).State(.read_only){ .core = &repo.core, .extra = .{ .moment = &moment } }; │ │124 │ │125 + // resolve annotated tags once, independently of the page's starting commit. │ │126 + { │ │127 + var tip = obj.Object(repo_kind, repo_opts).initCommit(state, io, gpa, &resolved.oid) catch { │ │128 + if (query != null) return error.NotFound; │ │129 + return emptyResult(aa, location, resolved.ref_or_oid, resolved.value, content, base_oid); │ │130 + }; │ │131 + defer tip.deinit(); │ │132 + resolved.oid = tip.oid; │ │133 + } │ │134 + │ │135 // collect this page's commit metadata, plus a peek at the one after it (its │ │136 // oid is the next page's start). the diff for each is rendered afterward, so │ │137 // the log iterator is closed before opening per-commit diff iterators. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │147 // bounded by a base, whose version also covers the commits before it. │ │148 if (comptime repo_kind == .xit) index: { │ │149 if (location != .repo or resolved.ref_or_oid == .object or base_oid.len != 0) break :index; │ │140 - // versions are keyed by commit, so an annotated tag is peeled first │ │141 - var tip = obj.Object(.xit, repo_opts).initCommit(state, io, gpa, &resolved.oid) catch break :index;│ │142 - defer tip.deinit(); │ │143 - resolved.oid = tip.oid; │ │150 const index = (try cms.lookup(repo_opts, moment, &resolved.oid)) orelse break :index; │ │151 search_available = true; │ │152 const text = query orelse break :index; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │185 defer iter.deinit(); │ │186 while (try iter.next(gpa)) |commit_object| { │ │187 defer commit_object.deinit(); │ │182 - // count from the commit itself when the tip is an annotated tag │ │183 - if (count == 0 and from.len == 0) resolved.oid = commit_object.oid;│ │188 // the base is a stopping point, not an ancestry exclusion │ │189 if (std.mem.eql(u8, &commit_object.oid, base_oid)) break; │ │190 if (count == page_size) { │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │216 .ref_or_oid_value = resolved.value, │ │217 .base_oid = try aa.dupe(u8, base_oid), │ │218 .commit_count = if (repo_kind == .xit and location == .repo) blk: { │ │215 - if (base_oid.len == 0) break :blk repo.commitCount(io, gpa, .{ .oid = &resolved.oid }) catch null; │ │219 + if (base_oid.len == 0) { │ │220 + const stats = (xit.patch.readCommitStats(repo_opts, state.extra.moment, &resolved.oid) catch null) orelse break :blk null;│ │221 + break :blk stats.first_parent_depth; │ │222 + } │ │223 break :blk evt.PatchRev.commitCount(repo_kind, repo_opts, state, io, gpa, base_oid, &resolved.oid) catch null; │ │224 } else null, │ │225 .commits = try aa.dupe(Commit, buf[0..count]), │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯