╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │628 const moment = try evt.currentMoment(.{}, &draft); │ │629 const patch = (try evt.Patch.readById(evt.EventDB(.sha1), .sha1, moment, &arena, &fork_id)) orelse return error.NotFound; │ │630 try std.testing.expect(!patch.removed); │ │631 - first_revision_id = try evt.parseEventId(&(patch.event.revision orelse return error.NotFound).id); │ │631 + try std.testing.expectEqualStrings(&source_oid, &(try draft.readRef(io, fork.ref) orelse return error.NotFound)); │ │632 + const selected = patch.event.revision orelse return error.NotFound; │ │633 + try std.testing.expectEqualStrings("refs/heads/master", selected.target_ref); │ │634 + try std.testing.expectEqualStrings(&source_oid, selected.source_oid); │ │635 + first_revision_id = try evt.parseEventId(&selected.id); │ │636 const revision = (try evt.PatchRev.readById(evt.EventDB(.sha1), .sha1, moment, &arena, &first_revision_id)) orelse return error.NotFound;│ │637 try std.testing.expectEqualStrings("refs/heads/master", revision.event.target_ref); │ │638 try std.testing.expectEqualStrings(&source_oid, revision.event.source_oid); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │647 defer admin.deinit(io, allocator); │ │648 var target = try rp.Repo(.xit, .{}).open(io, allocator, .{ .path = target_path });│ │649 defer target.deinit(io, allocator); │ │650 + try target.addBranch(io, .{ .name = "feature" }); │ │651 try pch.post(.{}, io, allocator, &admin, &target, draft_path, .{ │ │652 .id = fork_id_hex, │ │653 .user_id = user_id, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │673 }}); │ │674 } │ │675 │ │676 + const feature_remote_url = try std.fmt.allocPrint(allocator, "git@localhost: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 + │ │680 const second_source_oid = blk: { │ │681 const file = try client.core.work_dir.createFile(io, "feature.txt", .{ .truncate = true }); │ │682 defer file.close(io); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │684 try client.add(io, allocator, &.{"feature.txt"}); │ │685 break :blk try client.commit(io, allocator, .{ .message = "revise feature" }); │ │686 }; │ │678 - try client.push(io, allocator, "patch", "master:patch", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } }); │ │687 + try client.push(io, allocator, "patch-to-feature", "master:patch", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } });│ │688 │ │689 var second_revision_id: [evt.event_id_size]u8 = undefined; │ │690 var second_patch_oid: [hash.hexLen(.sha1)]u8 = undefined; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │701 @memcpy(&second_patch_oid, newest.record.patch_oid); │ │702 try std.testing.expect(!std.mem.eql(u8, &first_revision_id, &second_revision_id)); │ │703 try std.testing.expectEqualStrings(&second_source_oid, newest.record.event.source_oid); │ │704 + try std.testing.expectEqualStrings("refs/heads/feature", newest.record.event.target_ref);│ │705 try std.testing.expectEqualStrings("edited feature", newest.record.event.message); │ │706 } │ │707 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │712 const moment = try evt.currentMoment(.{}, &target); │ │713 const patch = (try evt.Patch.readById(evt.EventDB(.sha1), .sha1, moment, &arena, &fork_id)) orelse return error.NotFound; │ │714 try std.testing.expectEqualStrings("edited feature", patch.event.title); │ │705 - try std.testing.expectEqualStrings(&std.fmt.bytesToHex(second_revision_id, .lower), &(patch.event.revision orelse return error.NotFound).id);│ │715 + const selected = patch.event.revision orelse return error.NotFound; │ │716 + try std.testing.expectEqualStrings(&std.fmt.bytesToHex(second_revision_id, .lower), &selected.id); │ │717 + try std.testing.expectEqualStrings(&second_source_oid, selected.source_oid); │ │718 + try std.testing.expectEqualStrings("refs/heads/feature", selected.target_ref); │ │719 } │ │720 │ │721 // │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │729 try client.add(io, allocator, &.{"feature.txt"}); │ │730 break :blk try client.commit(io, allocator, .{ .message = "rejected revision" }); │ │731 }; │ │719 - const extra_ref_rejected = if (client.push(io, allocator, "patch", "master:patch", false, .{ │ │732 + const extra_ref_rejected = if (client.push(io, allocator, "patch-to-feature", "master:patch", false, .{│ │733 .refspecs = &.{"refs/heads/master:refs/heads/extra"}, │ │734 .wire = .{ .ssh = .{ .command = ssh_cmd } }, │ │735 })) |_| false else |_| true; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │755 defer target.deinit(io, allocator); │ │756 try evt.remove(.repo, .xit, .{}, io, allocator, &target, &fork_id, .patch, .{ .name = "admin", .email = "admin@example.test" });│ │757 } │ │745 - try client.push(io, allocator, "patch", "master:patch", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } }); │ │758 + try client.push(io, allocator, "patch-to-feature", "master:patch", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } }); │ │759 { │ │760 var target = try rp.Repo(.xit, .{}).open(io, allocator, .{ .path = target_path }); │ │761 defer target.deinit(io, allocator); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │786 } │ │787 const merge_parents = [_][hash.hexLen(.sha1)]u8{ third_source_oid, second_source_oid }; │ │788 _ = try client.commit(io, allocator, .{ .message = "merge patch", .parent_oids = &merge_parents }); │ │776 - try client.push(io, allocator, "origin", "master:master", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } }); │ │789 + try client.push(io, allocator, "origin", "master:feature", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } });│ │790 { │ │791 var target = try rp.Repo(.xit, .{}).open(io, allocator, .{ .path = target_path }); │ │792 defer target.deinit(io, allocator); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯