╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Settings.zig ─────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
408 }; 409 410 // change the repo `identity` names as `actor`, its owner, returning its 411 // settings route under its new name 412 pub fn update( 413 io: std.Io, 414 allocator: std.mem.Allocator, 415 users_dir: []const u8, 416 actor: ui.Actor, 417 identity: []const u8, 418 name: []const u8, 419 description: []const u8, 420 access: evt.Repo.Access, 421 discuss_role: ?evt.Repo.Role, 422 issue_role: ?evt.Repo.Role, 423 patch_role: ?evt.Repo.Role, 424 ) !ui.RoutablePage { 425 const parsed = ui.RoutablePage.RepoIdentity.parse(identity) orelse return error.NotFound; 426 const owner_id = actor.repo_user_id orelse return error.NotFound; 427 try evt.updateRepo(io, allocator, users_dir, &owner_id, actor.author, parsed.name, name, description, access, discuss_role, issue_role, patch_role); 428 var buf: [ui.RoutablePage.repo_route_max_len]u8 = undefined; 429 const new_identity = std.fmt.bufPrint(&buf, "{s}:{s}", .{ parsed.owner, name }) catch return error.RouteTooLong; 430 return ui.RoutablePage.repoSettingsRoute(new_identity) orelse error.RouteTooLong; 431 } 432