╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──╮ │src/lib.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────╮ │3 pub const main = @import("./main.zig"); │ │4 pub const event = @import("./event.zig"); │ │5 pub const fork = @import("./fork.zig"); │ │6 +pub const pch = @import("./patch.zig"); │ │7 pub const serve = @import("./serve.zig"); │ │8 pub const serve_ssh = @import("./serve_ssh.zig"); │ │9 pub const serve_ssh_protocol = @import("./serve_ssh_protocol.zig");│ ╰──────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────╮ │src/serve_common.zig│ ╰────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │20 create_if_missing: bool, │ │21 ) !RepoPath { │ │22 const owner_repo = evt.parseOwnerRepoPath(requested) orelse return .invalid; │ │23 - const event_id_hex = (try evt.resolveOrCreateRepo(io, allocator, admin_repo_path, owner_repo.owner, owner_repo.name, .{│ │24 - .create = if (create_if_missing) .{} else null, │ │25 - })) orelse return .not_found; │ │23 + const event_id_hex = (try evt.resolveOrCreateRepo( │ │24 + io, │ │25 + allocator, │ │26 + admin_repo_path, │ │27 + owner_repo.owner, │ │28 + owner_repo.name, │ │29 + if (create_if_missing) .{} else null, │ │30 + )) orelse return .not_found; │ │31 return .{ .ok = try std.fs.path.join(allocator, &.{ repo_root_path, &event_id_hex }) }; │ │32 } │ │33 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────╮ │src/serve_ssh.zig│ ╰─────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │403 }; │ │404 defer allocator.free(repo_path); │ │405 │ │406 - if (try serveIfExists(repo_path, sess, io, allocator, parsed.service)) { │ │406 + if (try serveIfExists(repo_path, handler.repo_root_path, sess, io, allocator, parsed.service)) {│ │407 try sess.exit(0); │ │408 return; │ │409 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │413 // create the on-disk repo for the just-minted event and serve the push │ │414 var repo = try createRepo(any_repo_opts.toRepoOpts(), io, allocator, repo_path); │ │415 defer repo.deinit(io, allocator); │ │416 - try servePack(repo.self_repo_opts, &repo, sess, io, allocator, parsed.service); │ │416 + try servePack(repo.self_repo_opts, &repo, handler.repo_root_path, sess, io, allocator, parsed.service);│ │417 try sess.exit(0); │ │418 } │ │419 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │420 // serve an existing repo at `repo_path`, or return false if none is there│ │421 fn serveIfExists( │ │422 repo_path: []const u8, │ │423 + repo_root_path: []const u8, │ │424 sess: *ssh.SessionCtx, │ │425 io: std.Io, │ │426 allocator: std.mem.Allocator, │ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │438 defer any_repo.deinit(io, allocator); │ │439 │ │440 switch (any_repo) { │ │440 - inline else => |*repo| try servePack(repo.self_repo_opts, repo, sess, io, allocator, service), │ │441 + inline else => |*repo| try servePack(repo.self_repo_opts, repo, repo_root_path, sess, io, allocator, service),│ │442 } │ │443 return true; │ │444 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────╮ │462 fn servePack( │ │463 comptime repo_opts: rp.RepoOpts(.xit),│ │464 repo: *rp.Repo(.xit, repo_opts), │ │465 + repo_root_path: []const u8, │ │466 sess: *ssh.SessionCtx, │ │467 io: std.Io, │ │468 allocator: std.mem.Allocator, │ ╰───────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │475 │ │476 switch (service) { │ │477 .upload_pack => try repo.uploadPack(io, allocator, &session_reader.interface, &session_writer.interface, .{}), │ │476 - .receive_pack => try evt.receivePackAndConsume(repo_opts, io, allocator, repo, &session_reader.interface, &session_writer.interface, .{}), │ │478 + .receive_pack => try evt.receivePackAndConsume(repo_opts, io, allocator, repo, &session_reader.interface, &session_writer.interface, .{}, repo_root_path),│ │479 } │ │480 │ │481 // flush whatever the pack op buffered into our writer adapter │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────────╮ │src/test/event/admin.zig│ ╰────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │425 const draft_moment = try evt.currentMoment(fork_repo_opts, &draft_repo); │ │426 const draft = (try evt.Patch.readById(evt.EventDB(fork_repo_opts.hash), fork_repo_opts.hash, draft_moment, &arena, &fork_id)) orelse return error.NotFound;│ │427 try std.testing.expectEqualStrings("add a feature", draft.event.title); │ │428 - try std.testing.expectEqual(null, draft.event.patchrev_id); │ │428 + try std.testing.expectEqual(null, draft.event.revision); │ │429 │ │430 var wrong_user_id = user_id; │ │431 wrong_user_id[0] ^= 1; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────────╮ │src/test/event/patch.zig│ ╰────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │ 6 const hash = xit.hash; │ │ 7 const rf = xit.ref; │ │ 8 const fork = @import("../../fork.zig"); │ │ 9 +const pch = @import("../../patch.zig"); │ │10 │ │11 const repo_opts: rp.RepoOpts(.xit) = .{ .is_test = true };│ │12 const Repo = rp.Repo(.xit, repo_opts); │ ╰──────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯