╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │592 { │ │593 var draft = try rp.Repo(.xit, .{}).open(io, allocator, .{ .path = draft_path });│ │594 defer draft.deinit(io, allocator); │ │595 + try std.testing.expect(try draft.isBare(io, allocator)); │ │596 var arena = std.heap.ArenaAllocator.init(allocator); │ │597 defer arena.deinit(); │ │598 const moment = try evt.currentMoment(.{}, &draft); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │790 clone_path, │ │791 clone_path, │ │792 null, │ │824 - .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } }, │ │793 + .{ .transport = .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } } }, │ │794 ); │ │795 defer fork_clone.deinit(io, allocator); │ │796 try std.testing.expectEqualStrings(&third_source_oid, &(try fork_clone.readRef(io, fork.ref) orelse return error.NotFound));│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │905 │ │906 var server_repo = try rp.Repo(.xit, .{ .is_test = true }).open(io, allocator, .{ .path = server_path });│ │907 defer server_repo.deinit(io, allocator); │ │908 + try std.testing.expect(try server_repo.isBare(io, allocator)); │ │909 │ │910 try std.testing.expect(null != try server_repo.readRef(io, .{ .kind = .tag, .name = "1.0.0" })); │ │911 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │943 │ │944 const repo_opts: rp.RepoOpts(.xit) = .{ .is_test = true }; │ │945 const ServerRepo = rp.Repo(.xit, repo_opts); │ │976 - var server_repo = try ServerRepo.init(io, allocator, .{ .path = server_path }); │ │946 + var server_repo = try ServerRepo.init(io, allocator, .{ .bare = true, .path = server_path });│ │947 defer server_repo.deinit(io, allocator); │ │948 │ │949 const cwd_path = try std.process.currentPathAlloc(io, allocator); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1102 │ │1103 // init server repo with default branch name as main │ │1104 // is_test must be false when shell_out_to_git so commits get real timestamps (needed for --shallow-since) │ │1135 - var server_repo = try rp.Repo(.xit, .{ .is_test = !shell_out_to_git }).init(io, allocator, .{ .path = server_path, .create_default_branch = "main" }); │ │1105 + var server_repo = try rp.Repo(.xit, .{ .is_test = !shell_out_to_git }).init(io, allocator, .{ .bare = true, .path = server_path, .create_default_branch = "main" });│ │1106 defer server_repo.deinit(io, allocator); │ │1107 │ │1108 if (shell_out_to_git) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1112 } │ │1113 │ │1114 // make a commit │ │1145 - { │ │1146 - const hello_txt = try server_repo.core.work_dir.createFile(io, "hello.txt", .{ .truncate = true }); │ │1147 - defer hello_txt.close(io); │ │1148 - try hello_txt.writeStreamingAll(io, "hello, world!"); │ │1149 - try server_repo.add(io, allocator, &.{"hello.txt"}); │ │1150 - _ = try server_repo.commit(io, allocator, .{ .message = "let there be light" }); │ │1151 - } │ │1115 + _ = try commitServer(&server_repo, io, allocator, .{ .files = &.{.{ .path = "hello.txt", .content = "hello, world!" }} }, .{ .message = "let there be light" });│ │1116 │ │1117 // tag first commit │ │1118 _ = try server_repo.addTag(io, allocator, .{ .name = "v1", .message = "first" }); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1119 │ │1120 // make a commit │ │1157 - { │ │1158 - const goodbye_txt = try server_repo.core.work_dir.createFile(io, "goodbye.txt", .{ .truncate = true }); │ │1159 - defer goodbye_txt.close(io); │ │1160 - try goodbye_txt.writeStreamingAll(io, "goodbye, world!"); │ │1161 - try server_repo.add(io, allocator, &.{"goodbye.txt"}); │ │1162 - _ = try server_repo.commit(io, allocator, .{ .message = "add goodbye file" }); │ │1163 - } │ │1121 + _ = try commitServer(&server_repo, io, allocator, .{ .files = &.{.{ .path = "goodbye.txt", .content = "goodbye, world!" }} }, .{ .message = "add goodbye file" });│ │1122 │ │1123 // export server repo │ │1124 { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1168 } │ │1169 │ │1170 // make a third commit on the server │ │1213 - { │ │1214 - const extra_txt = try server_repo.core.work_dir.createFile(io, "extra.txt", .{ .truncate = true }); │ │1215 - defer extra_txt.close(io); │ │1216 - try extra_txt.writeStreamingAll(io, "extra content"); │ │1217 - try server_repo.add(io, allocator, &.{"extra.txt"}); │ │1218 - _ = try server_repo.commit(io, allocator, .{ .message = "add extra file" }); │ │1219 - } │ │1171 + _ = try commitServer(&server_repo, io, allocator, .{ .files = &.{.{ .path = "extra.txt", .content = "extra content" }} }, .{ .message = "add extra file" });│ │1172 │ │1173 // pull --unshallow to deepen the clone and get the new commit │ │1174 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │1309 temp_path, │ │1310 client_path, │ │1311 null, │ │1360 - .{ .wire = .{ .ssh = .{ │ │1312 + .{ .transport = .{ .wire = .{ .ssh = .{│ │1313 .command = ssh_cmd_maybe, │ │1362 - } } }, │ │1314 + } } } }, │ │1315 ); │ │1316 defer client_repo.deinit(io, allocator); │ │1317 │ ╰─────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1358 const server_path = (try repoOnDiskPath(io, allocator, temp_dir_name, "testrepo", true)).?; │ │1359 defer allocator.free(server_path); │ │1360 │ │1409 - var server_repo = try rp.Repo(.xit, .{ .is_test = true }).init(io, allocator, .{ .path = server_path }); │ │1361 + var server_repo = try rp.Repo(.xit, .{ .is_test = true }).init(io, allocator, .{ .bare = true, .path = server_path }); │ │1362 defer server_repo.deinit(io, allocator); │ │1411 - │ │1412 - var server_dir = try cwd.openDir(io, server_path, .{}); │ │1413 - defer server_dir.close(io); │ │1414 - │ │1415 - // copy files from current repo into server dir │ │1416 - for (&[_][]const u8{"src"}) |dir_name| { │ │1417 - var src_repo_dir = try cwd.openDir(io, dir_name, .{ .iterate = true }); │ │1418 - defer src_repo_dir.close(io); │ │1419 - │ │1420 - var dest_repo_dir = try server_dir.createDirPathOpen(io, dir_name, .{}); │ │1421 - defer dest_repo_dir.close(io); │ │1422 - │ │1423 - try copyDir(io, src_repo_dir, dest_repo_dir); │ │1424 - │ │1425 - try server_repo.add(io, allocator, &.{dir_name}); │ │1426 - } │ │1363 │ │1428 - // make a commit │ │1429 - const commit1 = try server_repo.commit(io, allocator, .{ .message = "let there be light" }); │ │1364 + // make a commit with files from the current repo │ │1365 + const commit1 = try commitServer(&server_repo, io, allocator, .{ .dirs = &.{"src"} }, .{ .message = "let there be light" });│ │1366 │ │1367 // export server repo │ │1368 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯