╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │1518 │ │1519 return .{ .owner = owner, .name = name }; │ │1520 } │ │1521 + │ │1522 +pub const ResolveRepoOptions = struct { │ │1523 + create: ?CreateOptions = null, │ │1524 │ │1525 + pub const CreateOptions = struct { │ │1526 + read_access: Repo.Access = .private, │ │1527 + }; │ │1528 +}; │ │1529 + │ │1530 // resolve a pushed `<owner>/<repo>` to the hex event id that names its on-disk│ │1531 // directory under the repos dir │ │1532 pub fn resolveOrCreateRepo( │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1535 admin_repo_path: []const u8, │ │1536 owner_name: []const u8, │ │1537 repo_name: []const u8, │ │1530 - create_if_missing: bool, │ │1538 + options: ResolveRepoOptions, │ │1539 ) !?[event_id_size * 2]u8 { │ │1540 var repo = rp.Repo(.xit, admin_repo_opts).open(io, allocator, .{ .path = admin_repo_path }) catch |err| switch (err) {│ │1541 error.RepoNotFound => return null, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │1554 return std.fmt.bytesToHex(found.event_id, .lower); │ │1555 } │ │1556 │ │1549 - if (!create_if_missing) return null; │ │1557 + const create_options = options.create orelse return null; │ │1558 │ │1559 // the new repo is owned by the named user, read from the name index; an│ │1560 // unknown owner can't own a repo, so the push is rejected │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │1578 .user_id = &owner_user_id, │ │1579 .name = repo_name, │ │1580 .description = "", │ │1581 + .read_access = create_options.read_access,│ │1582 } }, │ │1583 }}); │ │1584 │ ╰────────────────────────────────────────────────────────────╯