╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │790 const id = std.fmt.bytesToHex(parts.thread_id, .lower); │ │791 const repos_dir = try std.fs.path.join(allocator, &.{ std.fs.path.dirname(remote.admin_repo_path) orelse ".", "repos" });│ │792 defer allocator.free(repos_dir); │ │793 - try pch.mergeAndRemoveFork(.{}, io, allocator, repos_dir, &admin_repo, &target_repo, .{ │ │793 + pch.mergeAndRemoveFork(.{}, io, allocator, repos_dir, &admin_repo, &target_repo, .{ │ │794 .id = id, │ │795 .revision = revision, │ │796 .author = author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │797 .timestamp = @intCast(std.Io.Timestamp.now(io, .real).toSeconds()), │ │798 - }); │ │798 + }) catch |err| switch (err) { │ │799 + error.MergeConflict => return request.respond("merge conflict", .{ │ │800 + .status = .conflict, │ │801 + .keep_alive = false, │ │802 + .extra_headers = &.{.{ .name = "content-type", .value = "text/plain" }}, │ │803 + }), │ │804 + error.MergeCheckUnavailable, error.PatchOutOfDate, error.PatchDataUnavailable => {}, │ │805 + else => return err, │ │806 + }; │ │807 │ │808 const location = try std.fmt.allocPrint(allocator, "{s}/patch:{s}", .{ parts.repo_base, &id });│ │809 defer allocator.free(location); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1199 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, source.localInitOpts()); │ │1200 defer any_repo.deinit(io, allocator); │ │1201 switch (any_repo) { │ │1194 - inline else => |*repo| try Event.update(repo_kind, repo.self_repo_opts, io, allocator, repo, id, update, author),│ │1202 + inline else => |*repo| { │ │1203 + try Event.update(repo_kind, repo.self_repo_opts, io, allocator, repo, id, update, author); │ │1204 + if (comptime Event == evt.Patch and repo_kind == .xit) { │ │1205 + if (host == .remote) pch.refreshMergeability(repo.self_repo_opts, io, allocator, repo, id.*); │ │1206 + } │ │1207 + }, │ │1208 } │ │1209 }, │ │1210 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯