╭ changed ───────────╮ │src/serve_common.zig│ ╰────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │ 7 pub const RepoPath = union(enum) { │ │ 8 ok: []const u8, // resolved on-disk path; the caller owns and frees it │ │ 9 invalid, // a <owner>:<repo> path was expected but not given │ │10 - not_found, // unknown owner, or the repo doesn't exist and we aren't creating│ │10 + not_found, // unknown owner, or the repo doesn't exist │ │11 }; │ │12 │ │13 // resolve a requested repo path to its on-disk directory, parsed as │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │14 -// <owner>:<repo> through the event store, minting a repo event for a fresh push.│ │14 +// <owner>:<repo> through the event store. │ │15 pub fn resolveRepoPath( │ │16 io: std.Io, │ │17 allocator: std.mem.Allocator, │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │18 users_dir: []const u8, │ │19 admin_repo_path: []const u8, │ │20 requested: []const u8, │ │21 - create_if_missing: bool, │ │21 ) !RepoPath { │ │22 const owner_repo = evt.parseOwnerRepoPath(requested) orelse return .invalid;│ │23 const location = (try evt.resolveOrCreateRepo( │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │27 admin_repo_path, │ │28 owner_repo.owner, │ │29 owner_repo.name, │ │31 - if (create_if_missing) .{} else null, │ │30 + null, │ │31 )) orelse return .not_found; │ │32 return .{ .ok = try evt.repoPath(allocator, users_dir, &location.owner_id, &location.repo_id) };│ │33 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯