╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │518 │ │519 const target_path = (try repoOnDiskPath(io, allocator, temp_path, "target", true)).?; │ │520 defer allocator.free(target_path); │ │521 - { │ │521 + const base_oid = blk: { │ │522 var target_repo = try rp.Repo(.xit, repo_opts).init(io, allocator, .{ .bare = true, .path = target_path }); │ │523 defer target_repo.deinit(io, allocator); │ │524 - _ = try commitServer(&target_repo, io, allocator, .{ .files = &.{.{ .path = "main.txt", .content = "base contents\n" }} }, .{ .author = "admin <admin@example.test>", .message = "initial code" }); │ │525 - } │ │524 + break :blk try commitServer(&target_repo, io, allocator, .{ .files = &.{.{ .path = "main.txt", .content = "base contents\n" }} }, .{ .author = "admin <admin@example.test>", .message = "initial code" });│ │525 + }; │ │526 │ │527 const other_path = (try repoOnDiskPath(io, allocator, temp_path, "other", true)).?; │ │528 defer allocator.free(other_path); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │731 } │ │732 │ │733 // │ │734 - // restore the patch, merge its source oid, and push the merge │ │734 + // restore the patch, merge a descendant of its source oid, and push the merge│ │735 // │ │736 │ │737 { │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │748 .event = .{ .patch = removed.event }, │ │749 }}); │ │750 } │ │751 - const merge_parents = [_][hash.hexLen(hash_kind)]u8{ third_source_oid, second_source_oid }; │ │752 - _ = try client.commit(io, allocator, .{ .message = "merge patch", .parent_oids = &merge_parents }); │ │751 + const merge_parents = [_][hash.hexLen(hash_kind)]u8{ base_oid, third_source_oid }; │ │752 + const merge_oid = try client.commit(io, allocator, .{ .message = "merge patch", .parent_oids = &merge_parents }); │ │753 + // later commits in the push must not be mistaken for the merge itself │ │754 + _ = try client.commit(io, allocator, .{ .message = "after merge", .allow_empty = true }); │ │755 try client.push(io, allocator, "origin", "master:feature", false, .{ .wire = .{ .ssh = .{ .command = ssh_cmd } } });│ │756 { │ │757 var target = try rp.Repo(.xit, repo_opts).open(io, allocator, .{ .path = target_path }); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │761 const moment = try evt.currentMoment(repo_opts, &target); │ │762 const patch = (try evt.Patch.readById(evt.EventDB(hash_kind), hash_kind, moment, &arena, &fork_id)) orelse return error.NotFound; │ │763 try std.testing.expectEqual(.merged, patch.event.status.kind()); │ │762 - const merged_oid = switch (patch.event.status) { │ │763 - .merged => |oid| oid, │ │764 + const merged_range = switch (patch.event.status) { │ │765 + .merged => |range| range, │ │766 else => return error.InvalidPatch, │ │767 }; │ │766 - try std.testing.expectEqualStrings(&second_source_oid, merged_oid); │ │768 + try std.testing.expectEqual(.source, merged_range.revision); │ │769 + try std.testing.expectEqualStrings(&base_oid, merged_range.before_oid); │ │770 + try std.testing.expectEqualStrings(&merge_oid, merged_range.after_oid); │ │771 const imported = (try evt.PatchRev.readById(evt.EventDB(hash_kind), hash_kind, moment, &arena, &second_revision_id)) orelse return error.NotFound;│ │772 try std.testing.expectEqualStrings(&second_patch_oid, imported.patch_oid); │ │773 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯