╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │354 return id; │ │355 } │ │356 if (session.data.host_kind == .local) return error.InvalidSourceBranch;│ │357 - const repos_dir = session.repos_dir orelse return error.NotFound; │ │357 + const users_dir = session.users_dir orelse return error.NotFound; │ │358 const user_id = actor.user_id orelse return error.NotFound; │ │359 const repo_id = data.repo_id orelse return error.NotFound; │ │360 const repo_user_id = actor.repo_user_id orelse return error.NotFound; │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │361 if (!evt.Patch.branchValid(target_branch) or !try repo_source.hasBranch(io, allocator, target_branch)) return error.InvalidTargetBranch;│ │362 - var user_repo = (try evt.openUserRepo(io, allocator, repos_dir, &user_id)) orelse return error.NotFound; │ │363 - defer user_repo.deinit(io, allocator); │ │364 - const fork_path = try fork.create(.{}, io, allocator, repos_dir, &user_repo, .{ │ │362 + const fork_path = try fork.create(.{}, io, allocator, users_dir, .{ │ │363 .id = id, │ │364 .user_id = user_id, │ │365 .repo_id = repo_id, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │377 │ │378 pub fn publishDraft(data: *const Self, session: *ui.Session, allocator: std.mem.Allocator, author: evt.CommitAuthor, id: []const u8) !void {│ │379 const io = session.io orelse return error.NotFound; │ │382 - const repos_dir = session.repos_dir orelse return error.NotFound; │ │380 + const users_dir = session.users_dir orelse return error.NotFound; │ │381 const admin_repo = session.admin_repo orelse return error.NotFound; │ │382 const repo_source = data.repo_source orelse return error.NotFound; │ │383 const repo_id = data.repo_id orelse return error.NotFound; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │385 const patch_id = evt.parseEventId(id) catch return error.NotFound; │ │386 │ │387 const id_hex = std.fmt.bytesToHex(patch_id, .lower); │ │390 - const fork_path = try fork.forkPath(allocator, repos_dir, &id_hex); │ │391 - defer allocator.free(fork_path); │ │392 - │ │388 var target_repo = try rp.Repo(.xit, .{}).open(io, allocator, repo_source.localInitOpts()); │ │389 defer target_repo.deinit(io, allocator); │ │395 - var user_repo = (try evt.openUserRepo(io, allocator, repos_dir, &user_id)) orelse return error.NotFound;│ │396 - defer user_repo.deinit(io, allocator); │ │397 - try pch.publish(.{}, io, allocator, admin_repo, &user_repo, &target_repo, fork_path, .{ │ │390 + try pch.publish(.{}, io, allocator, users_dir, admin_repo, &target_repo, .{ │ │391 .id = id_hex, │ │392 .user_id = user_id, │ │393 .repo_id = repo_id, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │398 │ │399 pub fn mergePatch(data: *const Self, session: *ui.Session, allocator: std.mem.Allocator, author: evt.CommitAuthor, id: []const u8, revision: evt.Patch.MergeRevision) !void {│ │400 const io = session.io orelse return error.NotFound; │ │408 - const repos_dir = session.repos_dir orelse return error.NotFound; │ │401 + const users_dir = session.users_dir orelse return error.NotFound; │ │402 const repo_source = data.repo_source orelse return error.NotFound; │ │403 if (repo_source.repo_kind != .xit) return error.NotFound; │ │404 const patch_id = evt.parseEventId(id) catch return error.NotFound; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │406 const id_hex = std.fmt.bytesToHex(patch_id, .lower); │ │407 var target_repo = try rp.Repo(.xit, .{}).open(io, allocator, repo_source.localInitOpts());│ │408 defer target_repo.deinit(io, allocator); │ │416 - try pch.mergeAndRemoveFork(.{}, io, allocator, repos_dir, &target_repo, .{ │ │409 + try pch.mergeAndRemoveFork(.{}, io, allocator, users_dir, &target_repo, .{ │ │410 .id = id_hex, │ │411 .revision = revision, │ │412 .author = author, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │426 target_branch: []const u8, │ │427 ) !void { │ │428 const io = session.io orelse return error.NotFound; │ │436 - const repos_dir = session.repos_dir orelse return error.NotFound; │ │429 + const users_dir = session.users_dir orelse return error.NotFound; │ │430 const admin_repo = session.admin_repo orelse return error.NotFound;│ │431 const repo_id = data.repo_id orelse return error.NotFound; │ │432 const repo_source = data.repo_source orelse return error.NotFound; │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │435 if (!evt.Patch.branchValid(target_branch) or !try repo_source.hasBranch(io, allocator, target_branch)) return error.InvalidTargetBranch;│ │436 │ │437 const id_hex = std.fmt.bytesToHex(patch_id, .lower); │ │445 - const fork_path = try fork.forkPath(allocator, repos_dir, &id_hex); │ │446 - defer allocator.free(fork_path); │ │447 - var user_repo = (try evt.openUserRepo(io, allocator, repos_dir, &user_id)) orelse return error.NotFound; │ │448 - defer user_repo.deinit(io, allocator); │ │449 - if (!try pch.editDraft(.{}, io, allocator, admin_repo, &user_repo, fork_path, .{ │ │438 + if (!try pch.editDraft(.{}, io, allocator, users_dir, admin_repo, .{ │ │439 .id = id_hex, │ │440 .user_id = user_id, │ │441 .repo_id = repo_id, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │450 │ │451 pub fn removeDraft(session: *ui.Session, allocator: std.mem.Allocator, author: evt.CommitAuthor, id: *const [evt.event_id_size]u8) !void {│ │452 const io = session.io orelse return error.NotFound; │ │464 - const repos_dir = session.repos_dir orelse return error.NotFound; │ │453 + const users_dir = session.users_dir orelse return error.NotFound; │ │454 const user_id = session.userId() orelse return error.NotFound; │ │455 │ │456 const id_hex = std.fmt.bytesToHex(id.*, .lower); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │468 - var user_repo = (try evt.openUserRepo(io, allocator, repos_dir, &user_id)) orelse return error.NotFound;│ │469 - defer user_repo.deinit(io, allocator); │ │470 - try fork.remove(io, allocator, repos_dir, &user_repo, &id_hex, author); │ │457 + try fork.remove(io, allocator, users_dir, &user_id, &id_hex, author); │ │458 } │ │459 │ │460 // `status`'s windowed listing. │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯