╭ changed ────╮ │src/patch.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1289 defer arena.deinit(); │ │1290 │ │1291 // identify which selected revision was merged by the client. │ │1215 - const patch_hex = std.fmt.bytesToHex(patch_id.*, .lower); │ │1216 - const fork_path = try fork.forkPath(arena.allocator(), repo_root_path, &patch_hex); │ │1292 const events = try evt.currentMomentFromRepoMoment(repo_opts.hash, moment.readOnly()); │ │1293 const record = (try evt.Patch.readById(evt.EventDB(repo_opts.hash), repo_opts.hash, events, &arena, patch_id)) orelse return;│ │1294 const selected = record.event.revision orelse return; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1295 const revision: evt.Patch.MergeRevision = if (std.mem.eql(u8, matched_oid, selected.source_oid)) .source else if (std.mem.eql(u8, matched_oid, selected.squash_oid)) .squash else return; │ │1296 │ │1297 // open the fork when the revision is not stored in the target repository. │ │1223 - var fork_repo_maybe: ?rp.Repo(.xit, repo_opts) = if (record.event.source_branch != null) null else try rp.Repo(.xit, repo_opts).open(io, allocator, .{ .path = fork_path, .require_repo_root = true });│ │1298 + var fork_repo_maybe: ?rp.Repo(.xit, repo_opts) = if (record.event.source_branch != null) null else blk: { │ │1299 + var config = try xit.config.Config(.xit, repo_opts).init(state.readOnly(), io, allocator); │ │1300 + defer config.deinit(); │ │1301 + const forker_id = (try fork.readForkerId(&config.sections, patch_id)) orelse return error.PatchDataUnavailable; │ │1302 + const fork_path = try fork.forkPath(arena.allocator(), users_dir, &forker_id, patch_id); │ │1303 + break :blk try rp.Repo(.xit, repo_opts).open(io, allocator, .{ .path = fork_path, .require_repo_root = true }); │ │1304 + }; │ │1305 defer if (fork_repo_maybe) |*repo| repo.deinit(io, allocator); │ │1306 │ │1307 // import the revision and record the client-side merge. │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │1415 moment: *evt.EventDB(repo_opts.hash).HashMap(.read_write), │ │1416 io: std.Io, │ │1417 allocator: std.mem.Allocator, │ │1337 - repo_root_path: []const u8, │ │1418 + users_dir: []const u8, │ │1419 updates: []const xit.net_server_receive_pack.AppliedRefUpdate,│ │1420 error_writer: *std.Io.Writer, │ │1421 ) !void { │ ╰────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1491 │ │1492 // a fast-forward has no recorded merge boundary; use the old ref tip │ │1493 const before_oid = if (std.mem.eql(u8, &commit.oid, &target.after_oid)) &old_oid else &target.before_oid; │ │1413 - importMerged(repo_opts, state, db, moment, io, allocator, repo_root_path, &patch_id, &commit.oid, before_oid, &target.after_oid) catch |err| {│ │1494 + importMerged(repo_opts, state, db, moment, io, allocator, users_dir, &patch_id, &commit.oid, before_oid, &target.after_oid) catch |err| { │ │1495 serve_common.logError(io, error_writer, "failed to mark patch {s} as merged: {s}\n", .{ &patch_hex, @errorName(err) }); │ │1496 continue; │ │1497 }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯