╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │43 window: Diff.Window = .{}, │ │44 }; │ │45 │ │46 -// where links and clone commands for this repository are rooted. │ │47 -location: ui.RoutablePage.RepoLocation, │ │46 +// where links and clone commands for this repository are rooted, and who views it.│ │47 +handle: ui.RepoHandle, │ │48 // the resolved ref/oid this log walks from (the default branch when the route │ │49 // didn't name one), so the page can canonicalize its url to it. │ │50 ref_or_oid: ui.RoutablePage.RefOrOid, │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │92 // the admin db's moment, for resolving author emails to user names (null│ │93 // in local mode, which has no users) │ │94 admin_moment: ?evt.AdminDB.HashMap(.read_only), │ │95 - location: ui.RoutablePage.RepoLocation, │ │95 + handle: ui.RepoHandle, │ │96 requested_ref_or_oid: ?ui.RoutablePage.RefOrOid, │ │97 requested_value: []const u8, │ │98 content: ui.RoutablePage.RepoCommitsRoute.Content, │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │127 // (NotFound -> 404); the default-branch path falls through to empty. │ │128 var resolved = (try ui.ResolvedRefOrOid(repo_kind, repo_opts).init(repo, io, aa, requested_ref_or_oid, requested_value)) orelse { │ │129 if (requested_ref_or_oid != null) return error.NotFound; │ │130 - return emptyResult(aa, location, .branch, requested_value, content, base_oid); │ │130 + return emptyResult(aa, handle, .branch, requested_value, content, base_oid); │ │131 }; │ │132 │ │133 - var moment = repo.core.latestMoment() catch return emptyResult(aa, location, resolved.ref_or_oid, resolved.value, content, base_oid);│ │133 + var moment = repo.core.latestMoment() catch return emptyResult(aa, handle, resolved.ref_or_oid, resolved.value, content, base_oid); │ │134 const state = rp.Repo(repo_kind, repo_opts).State(.read_only){ .core = &repo.core, .extra = .{ .moment = &moment } }; │ │135 │ │136 // resolve annotated tags once, independently of the page's starting commit. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │137 { │ │138 var tip = obj.Object(repo_kind, repo_opts).initCommit(state, io, gpa, &resolved.oid) catch { │ │139 if (query != null) return error.NotFound; │ │140 - return emptyResult(aa, location, resolved.ref_or_oid, resolved.value, content, base_oid);│ │140 + return emptyResult(aa, handle, resolved.ref_or_oid, resolved.value, content, base_oid); │ │141 }; │ │142 defer tip.deinit(); │ │143 resolved.oid = tip.oid; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │159 // a base, whose version would also cover the commits before it, searches │ │160 // the default branch instead. │ │161 if (comptime repo_kind == .xit) index: { │ │162 - if (location != .repo) break :index; │ │162 + if (handle.location != .repo) break :index; │ │163 if (resolved.ref_or_oid == .object or base_oid.len != 0) { │ │164 var head_buffer: [xit.ref.MAX_REF_CONTENT_SIZE]u8 = undefined; │ │165 const branch = switch (repo.head(io, &head_buffer) catch break :index) {│ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │204 var start_oid = resolved.oid; │ │205 if (from.len != 0) @memcpy(&start_oid, from); │ │206 │ │207 - var iter = repo.log(io, gpa, .{ .start_oids = &.{start_oid}, .first_parent = true }) catch return emptyResult(aa, location, resolved.ref_or_oid, resolved.value, content, base_oid);│ │207 + var iter = repo.log(io, gpa, .{ .start_oids = &.{start_oid}, .first_parent = true }) catch return emptyResult(aa, handle, resolved.ref_or_oid, resolved.value, content, base_oid); │ │208 defer iter.deinit(); │ │209 while (try iter.next(gpa)) |commit_object| { │ │210 defer commit_object.deinit(); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────╮ │234 } │ │235 │ │236 return .{ │ │237 - .location = try location.dupe(aa), │ │237 + .handle = try handle.dupe(aa), │ │238 .ref_or_oid = resolved.ref_or_oid, │ │239 .ref_or_oid_value = resolved.value, │ │240 .base_oid = try aa.dupe(u8, base_oid),│ ╰───────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │241 - .commit_count = if (repo_kind == .xit and location == .repo) blk: { │ │241 + .commit_count = if (repo_kind == .xit and handle.location == .repo) blk: { │ │242 if (base_oid.len == 0) { │ │243 const stats = (xit.patch.readCommitStats(repo_opts, state.extra.moment, &resolved.oid) catch null) orelse break :blk null;│ │244 break :blk stats.first_parent_depth; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │321 } │ │322 │ │323 // an empty listing pinned to a ref, for the wasm / no-repo / unresolved paths. │ │324 -pub fn emptyResult(aa: std.mem.Allocator, location: ui.RoutablePage.RepoLocation, ref_or_oid: ui.RoutablePage.RefOrOid, value: []const u8, content: ui.RoutablePage.RepoCommitsRoute.Content, base_oid: []const u8) !Self {│ │324 +pub fn emptyResult(aa: std.mem.Allocator, handle: ui.RepoHandle, ref_or_oid: ui.RoutablePage.RefOrOid, value: []const u8, content: ui.RoutablePage.RepoCommitsRoute.Content, base_oid: []const u8) !Self { │ │325 return .{ │ │326 - .location = try location.dupe(aa), │ │326 + .handle = try handle.dupe(aa), │ │327 .ref_or_oid = ref_or_oid, │ │328 .ref_or_oid_value = try aa.dupe(u8, value), │ │329 .base_oid = try aa.dupe(u8, base_oid), │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │466 │ │467 // the search box and the clone url at the top. local mode has neither. │ │468 if (session.data.host_kind == .server) { │ │469 - var header_view = try ui.widget.SearchHeader.init(allocator, session, data.location, " search ", "search", data.search, data.search_available); │ │469 + var header_view = try ui.widget.SearchHeader.init(allocator, session, data.handle, " search ", "search", data.search, data.search_available); │ │470 errdefer header_view.deinit(allocator); │ │471 // a row taller than the header, leaving a blank line beneath it │ │472 try outer.children.put(allocator, header_view.getFocus().id, .{ .widget = .{ .search_header = header_view }, .rect = null, .min_size = .{ .width = null, .height = 4 } });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯