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