╭ changed ────────╮ │src/serve_ssh.zig│ ╰─────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │317 │ │318 const parsed = parseGitCommand(allocator, command) catch return writeError(sess, "unsupported command (expected git-upload-pack or git-receive-pack)");│ │319 defer parsed.deinit(allocator); │ │320 - const repo_prefix = "/repo/"; │ │321 - const repo_identity = if (std.mem.startsWith(u8, parsed.dir, repo_prefix)) parsed.dir[repo_prefix.len..] else parsed.dir; │ │320 + const path = std.mem.trimStart(u8, parsed.dir, "/"); │ │321 + const fork_prefix = "fork/"; │ │322 │ │323 - if (fork.parseRoute(repo_identity)) |route| { │ │323 + if (std.mem.startsWith(u8, path, fork_prefix)) { │ │324 + const route = fork.parseRoute(path[fork_prefix.len..]) orelse return writeError(sess, "invalid fork path"); │ │325 const owner_repo = evt.parseOwnerRepoPath(route.identity) orelse return writeError(sess, "repo path must be <owner>/<repo>"); │ │326 if (parsed.service == .receive_pack and !xit.ref.validateName(route.target)) return writeError(sess, "invalid target branch"); │ │327 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │376 return; │ │377 } │ │378 │ │379 + const repo_prefix = "repo/"; │ │380 + const repo_identity = if (std.mem.startsWith(u8, path, repo_prefix)) path[repo_prefix.len..] else path;│ │381 + │ │382 const create_if_missing = parsed.service == .receive_pack; │ │383 const any_repo_opts: rp.AnyRepoOpts(.xit) = .{}; │ │384 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │614 break :blk try client.commit(io, allocator, .{ .message = "add feature" }); │ │615 }; │ │616 │ │617 - const remote_url = try std.fmt.allocPrint(allocator, "git@localhost:admin/target/patch:{s}/branch:master", .{&fork_id_hex}); │ │617 + const remote_url = try std.fmt.allocPrint(allocator, "git@localhost:fork/admin/target/patch:{s}/branch:master", .{&fork_id_hex});│ │618 defer allocator.free(remote_url); │ │619 try client.addRemote(io, allocator, .{ .name = "patch", .value = remote_url }); │ │620 try client.push(io, allocator, "patch", "master:patch", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } }); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │673 }}); │ │674 } │ │675 │ │676 - const feature_remote_url = try std.fmt.allocPrint(allocator, "git@localhost:admin/target/patch:{s}/branch:feature", .{&fork_id_hex}); │ │676 + const feature_remote_url = try std.fmt.allocPrint(allocator, "git@localhost:fork/admin/target/patch:{s}/branch:feature", .{&fork_id_hex});│ │677 defer allocator.free(feature_remote_url); │ │678 try client.addRemote(io, allocator, .{ .name = "patch-to-feature", .value = feature_remote_url }); │ │679 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │804 try std.testing.expectEqualStrings(&second_patch_oid, imported.patch_oid); │ │805 } │ │806 │ │807 - const other_url = try std.fmt.allocPrint(allocator, "git@localhost:admin/other/patch:{s}/branch:other", .{&fork_id_hex}); │ │807 + const other_url = try std.fmt.allocPrint(allocator, "git@localhost:fork/admin/other/patch:{s}/branch:other", .{&fork_id_hex}); │ │808 defer allocator.free(other_url); │ │809 try client.addRemote(io, allocator, .{ .name = "other", .value = other_url }); │ │810 const wrong_repo_rejected = if (client.push(io, allocator, "other", "master:patch", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } })) |_| false else |_| true;│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │861 }); │ │862 } │ │863 │ │864 - const denied_url = try std.fmt.allocPrint(allocator, "git@localhost:admin/target/patch:{s}/branch:denied", .{&fork_id_hex}); │ │864 + const denied_url = try std.fmt.allocPrint(allocator, "git@localhost:fork/admin/target/patch:{s}/branch:denied", .{&fork_id_hex}); │ │865 defer allocator.free(denied_url); │ │866 try client.addRemote(io, allocator, .{ .name = "denied", .value = denied_url }); │ │867 const unauthorized_rejected = if (client.push(io, allocator, "denied", "master:patch", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } })) |_| false else |_| true;│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │723 var field_count: usize = 0; │ │724 │ │725 if (status_kind != .merged and entry.fork_exists and entry.target_branch.len != 0) if (session.data.git_ssh_port) |port| { │ │726 - const url = try std.fmt.allocPrint(aa, "ssh://localhost:{d}/repo/{s}/patch:{s}/branch:{s}", .{ port, self.identity, entry.id, entry.target_branch });│ │726 + const url = try std.fmt.allocPrint(aa, "ssh://localhost:{d}/fork/{s}/patch:{s}/branch:{s}", .{ port, self.identity, entry.id, entry.target_branch });│ │727 const push_command = try std.fmt.allocPrint(aa, "git push {s} HEAD:patch", .{url}); │ │728 const clone_name = try cloneDirectoryName(aa, entry.record.event.title); │ │729 const clone_command = if (clone_name.len == 0) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1291 } │ │1292 }, │ │1293 .fork => |f| if (f.target_branch.len != 0) if (session.data.git_ssh_port) |port| { │ │1294 - const url = try std.fmt.allocPrint(aa, "ssh://localhost:{d}/repo/{s}/patch:{s}/branch:{s}", .{ port, f.identity, f.id, try ui.urlEncodeRef(aa, f.target_branch) });│ │1294 + const url = try std.fmt.allocPrint(aa, "ssh://localhost:{d}/fork/{s}/patch:{s}/branch:{s}", .{ port, f.identity, f.id, try ui.urlEncodeRef(aa, f.target_branch) });│ │1295 choices[count] = .{ │ │1296 .text = url, │ │1297 .copyable_text = try std.fmt.allocPrint(aa, "{s}git clone {s}", .{ session.data.git_ssh_prefix, url }), │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯