╭ changed ───╮ │src/fork.zig│ ╰────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │226 try std.Io.Dir.cwd().deleteTree(io, path); │ │227 } │ │228 │ │229 +// the id of the user who created the fork at `fork_path`, or null when it's gone │ │230 +pub fn readForkerId(io: std.Io, allocator: std.mem.Allocator, fork_path: []const u8) !?[evt.event_id_size]u8 { │ │231 + var fork_repo = rp.Repo(.xit, .{}).open(io, allocator, .{ .path = fork_path, .require_repo_root = true }) catch |err| switch (err) {│ │232 + error.RepoNotFound, error.FileNotFound => return null, │ │233 + else => |e| return e, │ │234 + }; │ │235 + defer fork_repo.deinit(io, allocator); │ │236 + var config = try fork_repo.listConfig(io, allocator); │ │237 + defer config.deinit(); │ │238 + const section = config.sections.get("haxy") orelse return error.InvalidPatchDraft; │ │239 + return try evt.parseEventId(section.get("forker") orelse return error.InvalidPatchDraft); │ │240 +} │ │241 + │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯