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