╭ changed ───────────────╮ │src/test/event/patch.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────╮ │813 const temp_path = try temp.dir.realPathFileAlloc(io, ".", allocator); │ │814 defer allocator.free(temp_path); │ │815 │ │816 - const repos_dir = try std.fs.path.join(allocator, &.{ temp_path, "repos" }); │ │817 - defer allocator.free(repos_dir); │ │816 + const users_dir = try std.fs.path.join(allocator, &.{ temp_path, "users" }); │ │817 + defer allocator.free(users_dir); │ │818 const admin_path = try std.fs.path.join(allocator, &.{ temp_path, "admin" }); │ │819 defer allocator.free(admin_path); │ │820 const upstream_path = try std.fs.path.join(allocator, &.{ temp_path, "upstream" });│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │826 const user_id = evt.EventWithId.randomId(prng.random()); │ │827 const repo_id = evt.EventWithId.randomId(prng.random()); │ │828 const repo_id_hex = std.fmt.bytesToHex(repo_id, .lower); │ │829 - const target_path = try std.fs.path.join(allocator, &.{ repos_dir, &repo_id_hex }); │ │829 + const target_path = try evt.repoPath(allocator, users_dir, &user_id, &repo_id); │ │830 defer allocator.free(target_path); │ │831 │ │832 var admin = try rp.Repo(.xit, evt.admin_repo_opts).init(io, allocator, .{ .path = admin_path });│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │843 } }, │ │844 }, │ │845 }); │ │846 - const user_repo_path = try evt.userRepoPath(allocator, repos_dir, &user_id);│ │846 + const user_repo_path = try evt.userRepoPath(allocator, users_dir, &user_id);│ │847 defer allocator.free(user_repo_path); │ │848 var user_repo = try evt.initUserRepo(io, allocator, user_repo_path); │ │849 defer user_repo.deinit(io, allocator); │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │882 │ │883 const patch_id = evt.EventWithId.randomId(prng.random()); │ │884 const patch_id_hex = std.fmt.bytesToHex(patch_id, .lower); │ │885 - const draft_path = try fork.create(repo_opts, io, allocator, repos_dir, &user_repo, .{│ │885 + const draft_path = try fork.create(repo_opts, io, allocator, users_dir, .{ │ │886 .target_branch = "master", │ │887 .id = patch_id_hex, │ │888 .user_id = user_id, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │968 │ │969 const unpushed_id = evt.EventWithId.randomId(prng.random()); │ │970 const unpushed_id_hex = std.fmt.bytesToHex(unpushed_id, .lower); │ │971 - const unpushed_path = try fork.create(repo_opts, io, allocator, repos_dir, &user_repo, .{│ │971 + const unpushed_path = try fork.create(repo_opts, io, allocator, users_dir, .{ │ │972 .id = unpushed_id_hex, │ │973 .user_id = user_id, │ │974 .repo_id = repo_id, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │981 .timestamp = 3, │ │982 }); │ │983 defer allocator.free(unpushed_path); │ │984 - try pch.publish(repo_opts, io, allocator, &admin, &user_repo, &target, unpushed_path, .{│ │984 + try pch.publish(repo_opts, io, allocator, users_dir, &admin, &target, .{ │ │985 .id = unpushed_id_hex, │ │986 .user_id = user_id, │ │987 .repo_id = repo_id, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1006 // edit the patch metadata in the fork │ │1007 // │ │1008 │ │1009 - try std.testing.expect(try pch.editDraft(repo_opts, io, allocator, &admin, &user_repo, draft_path, .{│ │1009 + try std.testing.expect(try pch.editDraft(repo_opts, io, allocator, users_dir, &admin, .{ │ │1010 .id = patch_id_hex, │ │1011 .user_id = user_id, │ │1012 .repo_id = repo_id, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │1023 // │ │1024 │ │1025 const before_publish = try target.core.db.rootCursor().count(); │ │1026 - try pch.publish(repo_opts, io, allocator, &admin, &user_repo, &target, draft_path, .{│ │1026 + try pch.publish(repo_opts, io, allocator, users_dir, &admin, &target, .{ │ │1027 .id = patch_id_hex, │ │1028 .user_id = user_id, │ │1029 .repo_id = repo_id, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │1031 .timestamp = 5, │ │1032 }); │ │1033 try std.testing.expectEqual(before_publish + 1, try target.core.db.rootCursor().count());│ │1034 - try pch.publish(repo_opts, io, allocator, &admin, &user_repo, &target, draft_path, .{ │ │1034 + try pch.publish(repo_opts, io, allocator, users_dir, &admin, &target, .{ │ │1035 .id = patch_id_hex, │ │1036 .user_id = user_id, │ │1037 .repo_id = repo_id, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1083 // │ │1084 │ │1085 try evt.Patch.update(.server, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .closed }, author);│ │1086 - try std.testing.expectError(error.PatchClosed, pch.merge(repo_opts, io, allocator, repos_dir, &target, .{ │ │1086 + try std.testing.expectError(error.PatchClosed, pch.merge(repo_opts, io, allocator, users_dir, &target, .{ │ │1087 .id = patch_id_hex, │ │1088 .revision = merge_revision, │ │1089 .author = author, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯