╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │371 } │ │372 │ │373 // make a commit on the server │ │389 - { │ │390 - const hello_txt = try server_repo.core.work_dir.createFile(io, "hello.txt", .{ .truncate = true }); │ │391 - defer hello_txt.close(io); │ │392 - try hello_txt.writeStreamingAll(io, "hello, world from the server!"); │ │393 - try server_repo.add(io, allocator, &.{"hello.txt"}); │ │394 - _ = try server_repo.commit(io, allocator, .{ .message = "new commit from the server" }); │ │395 - } │ │374 + _ = try commitServer(&server_repo, io, allocator, .{ .files = &.{.{ .path = "hello.txt", .content = "hello, world from the server!" }} }, .{ .message = "new commit from the server" });│ │375 │ │376 // make another commit │ │377 const commit2 = blk: { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │395 )); │ │396 │ │397 // make a commit on the server with no parents, thus creating an incompatible git history │ │419 - { │ │420 - const hello_txt = try server_repo.core.work_dir.createFile(io, "hello.txt", .{ .truncate = true }); │ │421 - defer hello_txt.close(io); │ │422 - try hello_txt.writeStreamingAll(io, "hello, world from the server again!"); │ │423 - try server_repo.add(io, allocator, &.{"hello.txt"}); │ │424 - _ = try server_repo.commit(io, allocator, .{ .message = "new git history on the server", .parent_oids = &.{} }); │ │425 - } │ │398 + _ = try commitServer(&server_repo, io, allocator, .{ .files = &.{.{ .path = "hello.txt", .content = "hello, world from the server again!" }} }, .{ .message = "new git history on the server", .parent_oids = &.{} });│ │399 │ │400 // can't push because commit doesn't exist locally │ │401 try std.testing.expectError(error.RemoteRefContainsCommitsNotFoundLocally, client_repo.push( │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │517 const target_path = (try repoOnDiskPath(io, allocator, temp_dir_name, "target", true)).?; │ │518 defer allocator.free(target_path); │ │519 { │ │547 - var target_repo = try rp.Repo(.xit, .{}).init(io, allocator, .{ .path = target_path }); │ │520 + var target_repo = try rp.Repo(.xit, .{}).init(io, allocator, .{ .bare = true, .path = target_path }); │ │521 defer target_repo.deinit(io, allocator); │ │549 - const file = try target_repo.core.work_dir.createFile(io, "main.txt", .{ .truncate = true }); │ │550 - defer file.close(io); │ │551 - try file.writeStreamingAll(io, "base contents\n"); │ │552 - try target_repo.add(io, allocator, &.{"main.txt"}); │ │553 - _ = try target_repo.commit(io, allocator, .{ .author = "admin <admin@example.test>", .message = "initial code" }); │ │554 - try target_repo.addConfig(io, allocator, .{ .name = "receive.denycurrentbranch", .value = "updateinstead" }); │ │522 + _ = try commitServer(&target_repo, io, allocator, .{ .files = &.{.{ .path = "main.txt", .content = "base contents\n" }} }, .{ .author = "admin <admin@example.test>", .message = "initial code" });│ │523 } │ │524 │ │525 const other_path = (try repoOnDiskPath(io, allocator, temp_dir_name, "other", true)).?; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │571 client_path, │ │572 client_path, │ │573 null, │ │606 - .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } }, │ │574 + .{ .transport = .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } } },│ │575 ); │ │576 defer client.deinit(io, allocator); │ │577 │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │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" }); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯