╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───╮ │src/test.zig│ ╰────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────╮ │37 test "clone small" { │ │38 const io = std.testing.io; │ │39 const allocator = std.testing.allocator; │ │44 - try testClone(.xit, .xit, .{ .wire = .http }, 3020, false, false, io, allocator); │ │45 - try testClone(.xit, .xit, .{ .wire = .http }, 3021, false, true, io, allocator); │ │40 + try testClone(.xit, .{ .wire = .http }, 3030, false, io, allocator); │ │41 if (.windows != builtin.os.tag) { │ │47 - try testClone(.xit, .xit, .{ .wire = .ssh }, 3022, false, false, io, allocator);│ │48 - try testClone(.xit, .xit, .{ .wire = .ssh }, 3023, false, true, io, allocator); │ │42 + try testClone(.xit, .{ .wire = .ssh }, 3031, false, io, allocator); │ │43 } │ │44 } │ │45 │ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │46 test "clone small subprocess" { │ │47 const io = std.testing.io; │ │48 const allocator = std.testing.allocator; │ │55 - try testClone(.git, .xit, .{ .wire = .http }, 3030, true, false, io, allocator); │ │56 - try testClone(.git, .xit, .{ .wire = .http }, 3031, true, true, io, allocator); │ │49 + try testClone(.git, .{ .wire = .http }, 3040, true, io, allocator); │ │50 if (.windows != builtin.os.tag) { │ │58 - try testClone(.git, .xit, .{ .wire = .ssh }, 3032, true, false, io, allocator); │ │59 - try testClone(.git, .xit, .{ .wire = .ssh }, 3033, true, true, io, allocator); │ │51 + try testClone(.git, .{ .wire = .ssh }, 3041, true, io, allocator); │ │52 } │ │53 } │ │62 - │ │63 -test "fetch large" { │ │64 - const io = std.testing.io; │ │65 - const allocator = std.testing.allocator; │ │66 - try testFetchLarge(.git, .git, .{ .wire = .http }, 3040, false, false, io, allocator); │ │67 - if (.windows != builtin.os.tag) { │ │68 - try testFetchLarge(.git, .git, .{ .wire = .ssh }, 3041, false, false, io, allocator);│ │69 - } │ │70 -} │ │71 - │ │54 test "fetch large subprocess" { │ │73 - const io = std.testing.io; │ │74 - const allocator = std.testing.allocator; │ │75 - try testFetchLarge(.git, .xit, .{ .wire = .http }, 3050, true, false, io, allocator); │ │76 - try testFetchLarge(.git, .xit, .{ .wire = .http }, 3051, true, true, io, allocator); │ │77 - if (.windows != builtin.os.tag) { │ │78 - try testFetchLarge(.git, .xit, .{ .wire = .ssh }, 3052, true, false, io, allocator); │ │79 - try testFetchLarge(.git, .xit, .{ .wire = .ssh }, 3053, true, true, io, allocator); │ │80 - } │ │81 -} │ │82 - │ │83 -test "push large" { │ │55 const io = std.testing.io; │ │56 const allocator = std.testing.allocator; │ │86 - try testPushLarge(.git, .git, .{ .wire = .http }, 3060, false, false, io, allocator); │ │57 + try testFetchLarge(.git, .{ .wire = .http }, 3050, true, io, allocator); │ │58 if (.windows != builtin.os.tag) { │ │88 - try testPushLarge(.git, .git, .{ .wire = .ssh }, 3061, false, false, io, allocator); │ │59 + try testFetchLarge(.git, .{ .wire = .ssh }, 3051, true, io, allocator); │ │60 } │ │61 } │ │91 - │ │62 test "push large subprocess" { │ │63 const io = std.testing.io; │ │64 const allocator = std.testing.allocator; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │95 - try testPushLarge(.git, .xit, .{ .wire = .http }, 3070, true, false, io, allocator); │ │96 - try testPushLarge(.git, .xit, .{ .wire = .http }, 3071, true, true, io, allocator); │ │65 + try testPushLarge(.git, .{ .wire = .http }, 3060, true, io, allocator); │ │66 if (.windows != builtin.os.tag) { │ │98 - try testPushLarge(.git, .xit, .{ .wire = .ssh }, 3072, true, false, io, allocator);│ │99 - try testPushLarge(.git, .xit, .{ .wire = .ssh }, 3073, true, true, io, allocator); │ │67 + try testPushLarge(.git, .{ .wire = .ssh }, 3061, true, io, allocator); │ │68 } │ │69 } │ │70 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │ 71 fn Server( │ │104 - comptime server_repo_kind: rp.RepoKind, │ │ 72 comptime transport_def: net.TransportDefinition,│ │ 73 comptime temp_dir_name: []const u8, │ │ 74 comptime port: u16, │ ╰─────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────╮ │108 - comptime use_serve_command: bool,│ │ 75 ) type { │ │ 76 return struct { │ │ 77 core: Core, │ ╰──────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────╮ │ 79 const Core = switch (transport_def) { │ │ 80 .file => void, │ │ 81 .wire => |wire_kind| switch (wire_kind) { │ │116 - .http => if (use_serve_command) struct {│ │ 82 + .http => struct { │ │ 83 io: std.Io, │ │ 84 allocator: std.mem.Allocator, │ │ 85 process: ?std.process.Child, │ ╰─────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │120 - } else struct { │ │121 - io: std.Io, │ │122 - allocator: std.mem.Allocator, │ │123 - temp_dir_name: []const u8, │ │124 - stop_server_endpoint: []const u8, │ │125 - net_server: std.Io.net.Server, │ │126 - server_thread: std.Thread, │ │ 86 }, │ │ 87 .raw => unreachable, │ │129 - .ssh => if (use_serve_command) struct {│ │ 88 + .ssh => struct { │ │ 89 io: std.Io, │ │ 90 allocator: std.mem.Allocator, │ │ 91 sshd_process: ?std.process.Child, │ ╰────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────╮ │ 92 serve_process: ?std.process.Child,│ │134 - } else struct { │ │135 - io: std.Io, │ │136 - process: ?std.process.Child, │ │ 93 }, │ │ 94 }, │ │ 95 }; │ ╰───────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 97 fn init( │ │ 98 io: std.Io, │ │ 99 allocator: std.mem.Allocator, │ │144 - ) !Server(server_repo_kind, transport_def, temp_dir_name, port, use_serve_command) {│ │100 + ) !Server(transport_def, temp_dir_name, port) { │ │101 switch (transport_def) { │ │102 .file => return .{ .core = {} }, │ │103 .wire => |wire_kind| switch (wire_kind) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │148 - .http => { │ │149 - if (use_serve_command) { │ │150 - comptime { │ │151 - std.debug.assert(server_repo_kind == .xit); │ │152 - } │ │153 - return .{ │ │154 - .core = .{ │ │155 - .io = io, │ │156 - .allocator = allocator, │ │157 - .process = null, │ │158 - }, │ │159 - }; │ │160 - } │ │161 - │ │162 - const address = try std.Io.net.IpAddress.parseIp4("127.0.0.1", port); │ │163 - const net_server = try address.listen(io, .{ .reuse_address = true }); │ │164 - errdefer net_server.deinit(io); │ │165 - return .{ │ │166 - .core = .{ │ │167 - .io = io, │ │168 - .allocator = allocator, │ │169 - .temp_dir_name = temp_dir_name, │ │170 - .stop_server_endpoint = std.fmt.comptimePrint("http://127.0.0.1:{}/stop-server", .{port}),│ │171 - .net_server = net_server, │ │172 - .server_thread = undefined, │ │173 - }, │ │174 - }; │ │104 + .http => return .{ │ │105 + .core = .{ │ │106 + .io = io, │ │107 + .allocator = allocator, │ │108 + .process = null, │ │109 + }, │ │110 }, │ │111 .raw => unreachable, │ │112 .ssh => { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯