╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Commits.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
832 fn commitRowLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, commit: Commit, content: Content) ![]const u8 { 833 // a result roots the same results page at its commit, so the query 834 // survives following the row 835 if (data.search != null) { 836 const route = pageRoute(data, commit.oid) orelse return error.RouteTooLong; 837 return std.fmt.allocPrint(page_arena.allocator(), "ai:{s}", .{try route.toUrl(page_arena)}); 838 } 839 const route = (switch (content) { 840 .message => data.location.commitMessageRoute(.object, commit.oid, data.base_oid), 841 .diff => |diff| data.location.commitsRoute(.object, commit.oid, commit.window.start, diff.path, data.base_oid), 842 }) orelse return error.RouteTooLong; 843 const url = try route.toUrl(page_arena); 844 return std.fmt.allocPrint(page_arena.allocator(), "ai:{s}", .{url}); 845 } 846 847 // the "a:" link to the page showing `oid`'s message on its own. 848 fn messageLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, oid: []const u8) ![]const u8 { 849 const route = data.location.commitMessageRoute(.object, oid, data.base_oid) orelse return error.RouteTooLong; 850 const url = try route.toUrl(page_arena); 851 return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{url}); 852 } 853