╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Settings.zig ─────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
390 391 // change the repo `identity` names as `actor`, its owner, returning its 392 // settings route under its new name 393 pub fn update( 394 io: std.Io, 395 allocator: std.mem.Allocator, 396 users_dir: []const u8, 397 actor: ui.Actor, 398 identity: []const u8, 399 name: []const u8, 400 description: []const u8, 401 access: evt.Repo.Access, 402 discuss_role: ?evt.Repo.Role, 403 issue_role: ?evt.Repo.Role, 404 patch_role: ?evt.Repo.Role, 405 ) !ui.RoutablePage { 406 const parsed = ui.RoutablePage.RepoIdentity.parse(identity) orelse return error.NotFound; 407 const owner_id = actor.repo_user_id orelse return error.NotFound; 408 try evt.updateRepo(io, allocator, users_dir, &owner_id, actor.author, parsed.name, name, description, access, discuss_role, issue_role, patch_role); 409 var buf: [ui.RoutablePage.repo_route_max_len]u8 = undefined; 410 const new_identity = std.fmt.bufPrint(&buf, "{s}:{s}", .{ parsed.owner, name }) catch return error.RouteTooLong; 411 return ui.RoutablePage.repoSettingsRoute(new_identity) orelse error.RouteTooLong; 412 } 413