╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │1082 base_oid: [hash.hexLen(.sha1)]u8, │ │1083 path: []const u8, │ │1084 contents: []const []const u8, │ │1085 + // a base file the last commit removes │ │1086 + removed_path: ?[]const u8, │ │1087 ) !void { │ │1088 const patch_hex = std.fmt.bytesToHex(patch_id.*, .lower); │ │1089 const fork_path = try fork.forkPath(allocator, users_dir, forker_id, patch_id);│ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │1103 var writer = std.Io.Writer.Allocating.init(allocator); │ │1104 defer writer.deinit(); │ │1105 if (std.Io.Dir.path.dirname(path)) |dir| try fork_dir.createDirPath(io, dir);│ │1106 + const commit_count = contents.len + @intFromBool(removed_path != null); │ │1107 for (contents, 0..) |content, i| { │ │1108 { │ │1109 const file = try fork_dir.createFile(io, path, .{}); │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1112 } │ │1113 try fork_repo.add(io, allocator, &.{path}); │ │1114 writer.clearRetainingCapacity(); │ │1112 - try writer.writer.print("{s} ({d}/{d})", .{ title, i + 1, contents.len }); │ │1115 + try writer.writer.print("{s} ({d}/{d})", .{ title, i + 1, commit_count }); │ │1116 source_oid = try fork_repo.commit(io, allocator, .{ .message = writer.written(), .timestamp = timestamp + i }); │ │1117 } │ │1118 + if (removed_path) |removed| { │ │1119 + // the bare fork never checked the base files out, so only the index drops it │ │1120 + try fork_repo.remove(io, allocator, &.{removed}, .{ .update_work_dir = false }); │ │1121 + writer.clearRetainingCapacity(); │ │1122 + try writer.writer.print("{s} ({d}/{d})", .{ title, commit_count, commit_count }); │ │1123 + source_oid = try fork_repo.commit(io, allocator, .{ .message = writer.written(), .timestamp = timestamp + contents.len });│ │1124 + } │ │1125 try fork_repo.patchAll(io, allocator, null); │ │1126 try fork_repo.addConfig(io, allocator, .{ .name = "core.bare", .value = "true" }); │ │1127 try transaction(io, &fork_repo, Reindex{ .io = io, .allocator = allocator, .core = &fork_repo.core, .commits = false }); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │1181 alpha_edit: ?ScatterEdit = null, │ │1182 // based behind master, so merging it makes a merge commit│ │1183 behind_master: bool = false, │ │1184 + // a base file the patch removes │ │1185 + removed_path: ?[]const u8 = null, │ │1186 }{ │ │1187 .{ │ │1188 .title = "Draft a faster dependency scanner", │ ╰────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1208 .description = "Add a stable JSON representation of `inspect` results for scripts and editor integrations.",│ │1209 .labels = "enhancement cli", │ │1210 .status = .open, │ │1211 + .removed_path = "docs/dev/contribute.md", │ │1212 }, │ │1213 .{ │ │1214 .title = "Edit an adjacent line in alpha.txt", │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1280 } │ │1281 break :blk .{ "patch.txt", contents.len }; │ │1282 }; │ │1270 - try seedPatchRevision(io, allocator, users_dir, user_id, &patch_ids[i], patch.title, patch_author, timestamp + 1, random, base_oid, file_path, contents[0..count]); │ │1283 + try seedPatchRevision(io, allocator, users_dir, user_id, &patch_ids[i], patch.title, patch_author, timestamp + 1, random, base_oid, file_path, contents[0..count], patch.removed_path);│ │1284 } │ │1285 const status = patch.status orelse continue; │ │1286 try pch.publish(.{}, io, allocator, users_dir, admin_repo, target_repo, .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯