╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │1157 │ │1158 // make sure shallow clone was successful │ │1159 { │ │1219 - const hello_txt = try temp_dir.openFile(io, "client/hello.txt", .{});│ │1160 + const hello_txt = try temp.dir.openFile(io, "client/hello.txt", .{});│ │1161 hello_txt.close(io); │ │1162 } │ │1163 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │1164 // delete client and clone again with --shallow-exclude│ │1224 - try cwd.deleteTree(io, temp_dir_name ++ "/client"); │ │1165 + try temp.dir.deleteTree(io, "client"); │ │1166 │ │1167 { │ │1168 var process = try std.process.spawn(io, .{ │ ╰─────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │1183 │ │1184 // make sure shallow clone was successful │ │1185 { │ │1245 - const hello_txt = try temp_dir.openFile(io, "client/hello.txt", .{});│ │1186 + const hello_txt = try temp.dir.openFile(io, "client/hello.txt", .{});│ │1187 hello_txt.close(io); │ │1188 } │ │1189 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────╮ │1190 // delete client and clone again with --filter=blob:none│ │1250 - try cwd.deleteTree(io, temp_dir_name ++ "/client"); │ │1191 + try temp.dir.deleteTree(io, "client"); │ │1192 │ │1193 { │ │1194 var process = try std.process.spawn(io, .{ │ ╰──────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │1209 │ │1210 // make sure partial clone was successful │ │1211 { │ │1271 - const hello_txt = try temp_dir.openFile(io, "client/hello.txt", .{});│ │1212 + const hello_txt = try temp.dir.openFile(io, "client/hello.txt", .{});│ │1213 hello_txt.close(io); │ │1214 } │ │1215 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────╮ │1216 // delete client and clone again with --filter=tree:0│ │1276 - try cwd.deleteTree(io, temp_dir_name ++ "/client"); │ │1217 + try temp.dir.deleteTree(io, "client"); │ │1218 │ │1219 { │ │1220 var process = try std.process.spawn(io, .{ │ ╰───────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────╮ │1235 │ │1236 // make sure treeless clone was successful │ │1237 { │ │1297 - const goodbye_txt = try temp_dir.openFile(io, "client/goodbye.txt", .{});│ │1238 + const goodbye_txt = try temp.dir.openFile(io, "client/goodbye.txt", .{});│ │1239 goodbye_txt.close(io); │ │1240 } │ │1241 } else { │ ╰───────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1301 - const ssh_cmd_maybe = try sshCommand(is_ssh, allocator, cwd_path, temp_dir_name, port);│ │1242 + const ssh_cmd_maybe = try sshCommand(is_ssh, allocator, temp_path, port); │ │1243 defer if (ssh_cmd_maybe) |ssh_cmd| allocator.free(ssh_cmd); │ │1244 │ │1245 // clone repo │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │1262 try std.testing.expectEqualStrings("main", head.ref.name); │ │1263 │ │1264 // make sure clone was successful │ │1324 - const hello_txt = try temp_dir.openFile(io, "client/hello.txt", .{});│ │1265 + const hello_txt = try temp.dir.openFile(io, "client/hello.txt", .{});│ │1266 defer hello_txt.close(io); │ │1267 } │ │1268 } │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1275 io: std.Io, │ │1276 allocator: std.mem.Allocator, │ │1277 ) !void { │ │1337 - const temp_dir_name = "temp-testnet-fetch-large"; │ │1338 - │ │1278 // create the temp dir │ │1340 - const cwd = std.Io.Dir.cwd(); │ │1341 - var temp_dir_or_err = cwd.openDir(io, temp_dir_name, .{}); │ │1342 - if (temp_dir_or_err) |*temp_dir| { │ │1343 - temp_dir.close(io); │ │1344 - try cwd.deleteTree(io, temp_dir_name); │ │1345 - } else |_| {} │ │1346 - var temp_dir = try cwd.createDirPathOpen(io, temp_dir_name, .{}); │ │1347 - defer cwd.deleteTree(io, temp_dir_name) catch {}; │ │1348 - defer temp_dir.close(io); │ │1279 + var temp = std.testing.tmpDir(.{}); │ │1280 + defer temp.cleanup(); │ │1281 + const temp_path = try temp.dir.realPathFileAlloc(io, ".", allocator); │ │1282 + defer allocator.free(temp_path); │ │1283 │ │1284 // init server │ │1351 - var server_process = try runServer(io, allocator, temp_dir_name, port); │ │1285 + var server_process = try runServer(io, allocator, temp_path, port); │ │1286 defer _ = server_process.kill(io); │ │1353 - │ │1354 - const cwd_path = try std.process.currentPathAlloc(io, allocator); │ │1355 - defer allocator.free(cwd_path); │ │1287 │ │1288 // register the repo under admin and locate its on-disk directory │ │1358 - const server_path = (try repoOnDiskPath(io, allocator, temp_dir_name, "testrepo", true)).?; │ │1289 + const server_path = (try repoOnDiskPath(io, allocator, temp_path, "testrepo", true)).?; │ │1290 defer allocator.free(server_path); │ │1291 │ │1292 var server_repo = try rp.Repo(.xit, .{ .is_test = true }).init(io, allocator, .{ .bare = true, .path = server_path });│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯