╭ changed ───────────────╮ │src/test/event/admin.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │311 const temp_path = try temp.dir.realPathFileAlloc(io, ".", allocator); │ │312 defer allocator.free(temp_path); │ │313 │ │314 - const repos_dir = try std.fs.path.join(allocator, &.{ temp_path, "repos" }); │ │315 - defer allocator.free(repos_dir); │ │314 + const users_dir = try std.fs.path.join(allocator, &.{ temp_path, "users" }); │ │315 + defer allocator.free(users_dir); │ │316 const admin_path = try std.fs.path.join(allocator, &.{ temp_path, "admin" });│ │317 defer allocator.free(admin_path); │ │318 │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │319 var prng = std.Random.DefaultPrng.init(std.testing.random_seed);│ │320 const user_id = evt.EventWithId.randomId(prng.random()); │ │321 const repo_id = evt.EventWithId.randomId(prng.random()); │ │322 - const repo_id_hex = std.fmt.bytesToHex(repo_id, .lower); │ │322 const fork_id = evt.EventWithId.randomId(prng.random()); │ │323 const fork_id_hex = std.fmt.bytesToHex(fork_id, .lower); │ │324 │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │336 } }, │ │337 }, │ │338 }); │ │340 - const user_repo_path = try evt.userRepoPath(allocator, repos_dir, &user_id);│ │339 + const user_repo_path = try evt.userRepoPath(allocator, users_dir, &user_id);│ │340 defer allocator.free(user_repo_path); │ │341 var user_repo = try evt.initUserRepo(io, allocator, user_repo_path); │ │342 defer user_repo.deinit(io, allocator); │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │353 }, │ │354 }); │ │355 │ │357 - const target_path = try std.fs.path.join(allocator, &.{ repos_dir, &repo_id_hex }); │ │356 + const target_path = try evt.repoPath(allocator, users_dir, &user_id, &repo_id); │ │357 defer allocator.free(target_path); │ │358 var target = try rp.Repo(.xit, fork_repo_opts).init(io, allocator, .{ .path = target_path });│ │359 defer target.deinit(io, allocator); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │365 try target.add(io, allocator, &.{"README"}); │ │366 _ = try target.commit(io, allocator, .{ .message = "initial" }); │ │367 │ │369 - const draft_path = try fork.create(fork_repo_opts, io, allocator, repos_dir, &user_repo, .{│ │368 + const draft_path = try fork.create(fork_repo_opts, io, allocator, users_dir, .{ │ │369 .target_branch = "master", │ │370 .id = fork_id_hex, │ │371 .user_id = user_id, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │396 try std.testing.expectEqualStrings("add a feature", draft.event.title); │ │397 try std.testing.expectEqual(null, draft.event.revision); │ │398 │ │400 - try fork.remove(io, allocator, repos_dir, &user_repo, &fork_id_hex, author); │ │399 + try fork.remove(io, allocator, users_dir, &user_id, &fork_id_hex, author); │ │400 try std.testing.expectError(error.FileNotFound, std.Io.Dir.accessAbsolute(io, draft_path, .{}));│ │401 _ = arena.reset(.retain_capacity); │ │402 moment = try evt.currentMoment(evt.user_repo_opts, &user_repo); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │405 try std.testing.expectEqual(0, try activeForkCount(moment)); │ │406 try std.testing.expectEqual(0, try draftForkCount(moment, &repo_id)); │ │407 │ │409 - try fork.remove(io, allocator, repos_dir, &user_repo, &fork_id_hex, author); │ │408 + try fork.remove(io, allocator, users_dir, &user_id, &fork_id_hex, author); │ │409 } │ │410 │ │411 fn draftForkCount(moment: evt.UserDB.HashMap(.read_only), repo_id: []const u8) !u64 {│ ╰──────────────────────────────────────────────────────────────────────────────────────────╯