╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭───────────────────────────────────────────────────────╮ │689 fork_repo: *rp.Repo(.xit, .{}), │ │690 target_repo: *rp.Repo(repo_kind, repo_opts), │ │691 id: [evt.event_id_size]u8, │ │686 - default_target_branch: []const u8, │ │692 ) !?PatchWithId { │ │693 const aa = arena.allocator(); │ │694 const id_hex = std.fmt.bytesToHex(id, .lower);│ ╰───────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │695 const fork_oid = (try fork_repo.readRef(io, fork.ref)) orelse return null; │ │696 const moment = evt.currentMoment(.{}, fork_repo) catch return null; │ │697 const patch = (try evt.Patch.readById(evt.EventDB(.sha1), .sha1, moment, arena, &id)) orelse return null;│ │693 - var target_branch = default_target_branch; │ │694 - if (patch.event.revision) |revision| { │ │695 - target_branch = revision.targetBranch() orelse return null; │ │696 - } │ │697 - const target_oid = if (target_branch.len != 0) │ │698 - try target_repo.readRef(io, .{ .kind = .head, .name = target_branch }) │ │699 - else │ │700 - null; │ │698 + const target_branch = patch.event.target_branch; │ │699 + const target_oid = try target_repo.readRef(io, .{ .kind = .head, .name = target_branch }); │ │700 return .{ │ │701 .id = try aa.dupe(u8, &id_hex), │ │702 .record = patch, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │703 .author = try ui.Author.initFromEmail(admin_moment, arena, patch.author_email), │ │704 .draft = true, │ │705 .fork_oid = try aa.dupe(u8, &fork_oid), │ │707 - .target_branch = try aa.dupe(u8, target_branch), │ │706 .no_changes = if (target_oid) |oid| std.mem.eql(u8, &oid, &fork_oid) else false,│ │707 .fork_exists = true, │ │708 }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │717 pub fn appendDetails(self: *const Self, allocator: std.mem.Allocator, box: *wgt.Box(ui.Widget), session: *ui.Session, entry: Entry) !void {│ │718 const aa = session.page_arena.allocator(); │ │719 const status_kind = entry.record.event.status.kind(); │ │720 + const target_branch = entry.record.event.target_branch; │ │721 var fields: [2]ui.widget.CopyableText.Choice = undefined; │ │722 var field_count: usize = 0; │ │723 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │725 - if (status_kind != .merged and entry.fork_exists and entry.target_branch.len != 0) if (session.data.git_ssh_port) |port| { │ │726 - const url = try std.fmt.allocPrint(aa, "ssh://localhost:{d}/fork/{s}/patch:{s}/branch:{s}", .{ port, self.identity, entry.id, entry.target_branch });│ │724 + if (status_kind != .merged and entry.fork_exists) if (session.data.git_ssh_port) |port| { │ │725 + const url = try std.fmt.allocPrint(aa, "ssh://localhost:{d}/fork/{s}/patch:{s}", .{ port, self.identity, entry.id }); │ │726 const push_command = try std.fmt.allocPrint(aa, "git push {s} HEAD:patch", .{url}); │ │727 const clone_name = try cloneDirectoryName(aa, entry.record.event.title); │ │728 const clone_command = if (clone_name.len == 0) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │755 }; │ │756 field_count += 1; │ │757 } │ │759 - if (entry.target_branch.len != 0) { │ │760 - fields[field_count] = .{ │ │761 - .selector = "to", │ │762 - .text = entry.target_branch, │ │763 - .label = if (status_kind == .merged) " target branch this patch was merged into " else " target branch this patch will go to ",│ │764 - .bottom_label = if (status_kind == .merged) "" else " (set by the url you push to above) ", │ │765 - }; │ │766 - field_count += 1; │ │767 - } │ │758 + fields[field_count] = .{ │ │759 + .selector = "to", │ │760 + .text = target_branch, │ │761 + .label = if (status_kind == .merged) " target branch this patch was merged into " else " target branch this patch will go to ", │ │762 + }; │ │763 + field_count += 1; │ │764 │ │765 if (field_count > 0) { │ │766 var copyable_text = try ui.widget.CopyableText.init(allocator, session, fields[0..field_count]); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯