╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │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 } });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │731 tb.getFocus().mode = .all; │ │732 try inner.children.put(allocator, tb.getFocus().id, .{ .widget = .{ .text_box = tb }, .rect = null, .min_size = null }); │ │733 } │ │734 - if (commit.merge) if (self.data.location.commitsMergeRoute(commit.oid)) |route| { │ │734 + if (commit.merge) if (self.data.handle.location.commitsMergeRoute(commit.oid)) |route| { │ │735 try addLink(allocator, inner, "view commits from this merge", try std.fmt.allocPrint(self.session.page_arena.allocator(), "a:{s}", .{try route.toUrl(self.session.page_arena)}));│ │736 }; │ │737 if (commit.stats) |stats| { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │750 tb.getFocus().mode = .all; │ │751 try inner.children.put(allocator, tb.getFocus().id, .{ .widget = .{ .text_box = tb }, .rect = null, .min_size = null }); │ │752 } │ │753 - try addLink(allocator, inner, "view files at this commit", try filesObjectLink(self.session.page_arena, self.data.location, commit.oid)); │ │753 + try addLink(allocator, inner, "view files at this commit", try filesObjectLink(self.session.page_arena, self.data.handle.location, commit.oid));│ │754 } │ │755 │ │756 try (Diff{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │757 - .route = .{ .commit = .{ .location = self.data.location, .oid = commit.oid, .base_oid = self.data.base_oid } }, │ │757 + .route = .{ .commit = .{ .location = self.data.handle.location, .oid = commit.oid, .base_oid = self.data.base_oid } },│ │758 .path = d.path, │ │759 .window = commit.window, │ │760 }).appendWindow(allocator, self.session, inner); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │808 if (text.len == 0 and self.data.search == null) return; │ │809 // an object view or a base-bounded list searches the default branch, so the url says so │ │810 const route = if (self.data.default_branch.len != 0) │ │811 - self.data.location.commitsRoute(.branch, self.data.default_branch, 0, "", "") │ │811 + self.data.handle.location.commitsRoute(.branch, self.data.default_branch, 0, "", "") │ │812 else │ │813 - self.data.location.commitsRoute(self.data.ref_or_oid, self.data.ref_or_oid_value, 0, "", self.data.base_oid); │ │813 + self.data.handle.location.commitsRoute(self.data.ref_or_oid, self.data.ref_or_oid_value, 0, "", self.data.base_oid);│ │814 try self.session.navigate((route orelse return).withSearch(text) orelse return); │ │815 } │ │816 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯