╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Commits.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
844 // when `message` is set. the href is only followed with js off. 845 fn commitRowLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, commit: Commit, message: bool) ![]const u8 { 846 // a result roots the same results page at its commit, so the query 847 // survives following the row 848 if (data.search != null) { 849 const route = pageRoute(data, commit.oid) orelse return error.RouteTooLong; 850 return std.fmt.allocPrint(page_arena.allocator(), "ai:{s}", .{try route.toUrl(page_arena)}); 851 } 852 const route = (if (message) 853 data.handle.location.commitMessageRoute(.object, commit.oid, data.base_oid) 854 else 855 data.handle.location.commitsRoute(.object, commit.oid, data.base_oid)) orelse return error.RouteTooLong; 856 const url = try route.toUrl(page_arena); 857 return std.fmt.allocPrint(page_arena.allocator(), "ai:{s}", .{url}); 858 } 859 860 // the "a:" link to the page showing `oid`'s message on its own. 861 fn messageLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, oid: []const u8) ![]const u8 { 862 const route = data.handle.location.commitMessageRoute(.object, oid, data.base_oid) orelse return error.RouteTooLong; 863 const url = try route.toUrl(page_arena); 864 return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{url}); 865 } 866