╭ changed ────────╮ │src/serve_ssh.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────╮ │1 const std = @import("std"); │ │2 +const push = @import("push.zig");│ │3 const xit = @import("xit"); │ │4 const rp = xit.repo; │ │5 const xitui = xit.xitui; │ ╰────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │360 │ │361 const draft_path = try fork.forkPath(allocator, handler.repo_root_path, &route.id); │ │362 defer allocator.free(draft_path); │ │362 - var draft = rp.AnyRepo(.xit, .{ .ProgressCtx = *evt.PushProgress }).open(io, allocator, .{ .path = draft_path }) catch │ │363 + var draft = rp.AnyRepo(.xit, .{ .ProgressCtx = *push.PushProgress }).open(io, allocator, .{ .path = draft_path }) catch│ │364 return writeError(sess, "patch draft not found"); │ │365 defer draft.deinit(io, allocator); │ │366 var reader_buf: [4096]u8 = undefined; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │385 var target_repo = rp.Repo(.xit, repo.self_repo_opts).open(io, allocator, .{ .path = target_path }) catch │ │386 return writeError(sess, "repo not found or has the wrong hash"); │ │387 defer target_repo.deinit(io, allocator); │ │387 - try fork.receivePack(repo.self_repo_opts, io, allocator, repo, &target_repo, &route.id, author, timestamp, &reader.interface, &writer.interface, handler.err);│ │388 + try push.receiveFork(repo.self_repo_opts, io, allocator, repo, &target_repo, &route.id, author, timestamp, &reader.interface, &writer.interface, handler.err);│ │389 }, │ │390 } │ │391 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │398 const repo_identity = if (std.mem.startsWith(u8, path, repo_prefix)) path[repo_prefix.len..] else path; │ │399 │ │400 const create_if_missing = parsed.service == .receive_pack; │ │400 - const any_repo_opts: rp.AnyRepoOpts(.xit) = .{ .ProgressCtx = *evt.PushProgress }; │ │401 + const any_repo_opts: rp.AnyRepoOpts(.xit) = .{ .ProgressCtx = *push.PushProgress }; │ │402 │ │403 const owner_repo = evt.parseOwnerRepoPath(repo_identity) orelse return writeError(sess, "repo path must be <owner>/<repo>"); │ │404 switch (try authorizeRepoKey(io, allocator, handler.admin_repo_path, owner_repo.owner, owner_repo.name, parsed.service, &sess.fingerprint)) {│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │445 // attempt it when the path already exists │ │446 std.Io.Dir.accessAbsolute(io, repo_path, .{}) catch return false; │ │447 │ │447 - const any_repo_opts: rp.AnyRepoOpts(.xit) = .{ .ProgressCtx = *evt.PushProgress }; │ │448 + const any_repo_opts: rp.AnyRepoOpts(.xit) = .{ .ProgressCtx = *push.PushProgress }; │ │449 var any_repo = rp.AnyRepo(.xit, any_repo_opts).open(io, allocator, .{ .path = repo_path }) catch |err| switch (err) {│ │450 error.RepoNotFound => return false, │ │451 else => |e| return e, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │491 │ │492 switch (service) { │ │493 .upload_pack => try repo.uploadPack(io, allocator, &session_reader.interface, &session_writer.interface, .{}), │ │493 - .receive_pack => try evt.receivePackAndConsume(repo_opts, io, allocator, repo, &session_reader.interface, &session_writer.interface, .{}, repo_root_path, error_writer), │ │494 + .receive_pack => try push.receivePackAndConsume(repo_opts, io, allocator, repo, &session_reader.interface, &session_writer.interface, .{}, repo_root_path, error_writer),│ │495 } │ │496 │ │497 // flush whatever the pack op buffered into our writer adapter │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯