╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │273 return ui.RoutablePage.repoCommitsRoute(identity, .object, entry.revision_oid, 0, "", entry.base_oid) orelse error.RouteTooLong; │ │274 } │ │275 │ │276 +pub fn diffRoute(allocator: std.mem.Allocator, identity: []const u8, entry: PatchWithId) !?ui.RoutablePage { │ │277 + // merged patches show what actually landed, including conflict resolutions │ │278 + if (entry.record.event.status == .merged) { │ │279 + return ui.RoutablePage.repoPatchRevDiffRoute(identity, &entry.record.event.status.merged.patchrev_id, 0, "") orelse error.RouteTooLong;│ │280 + } │ │281 + const route = (try commitsRoute(allocator, identity, entry)) orelse return null; │ │282 + return switch (route) { │ │283 + .fork_commits => ui.RoutablePage.forkDiffRoute(identity, entry.id, 0, ""), │ │284 + .repo_commits => |c| ui.RoutablePage.repoDiffRoute(identity, c.ref_or_oid, c.value.slice(), 0, "", c.base_oid.slice()), │ │285 + else => unreachable, │ │286 + } orelse error.RouteTooLong; │ │287 +} │ │288 + │ │289 pub fn draftsRoute(identity: []const u8) ?ui.RoutablePage { │ │290 return ui.RoutablePage.repoPatchesDraftsRoute(identity); │ │291 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯