╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ net.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
1917 var tree = try xit.object.Tree.initFromIndex(.xit, opts, state, ctx.io, ctx.allocator, &index); 1918 defer tree.deinit(); 1919 var head_buffer: [rf.MAX_REF_CONTENT_SIZE]u8 = undefined; 1920 const head = try rf.readHead(.xit, opts, state.readOnly(), ctx.io, &head_buffer) orelse return error.HeadNotFound; 1921 ctx.result.* = try xit.object.writeCommit(.xit, opts, state, ctx.io, ctx.allocator, ctx.metadata, &tree, head.ref); 1922 try xit.undo.write(opts, state, std.Io.Timestamp.now(ctx.io, .real).toSeconds(), .{ .commit = try .init(ctx.metadata.message, ctx.result.*, opts.max_read_size) }); 1923 } 1924 }; 1925 try repo.core.db_file.lock(io, .exclusive); 1926 defer repo.core.db_file.unlock(io); 1927 const history = try R.DB.ArrayList(.read_write).init(repo.core.db.rootCursor()); 1928 try history.appendContext(.{ .slot = try history.getSlot(-1) }, Ctx{ 1929 .core = &repo.core, 1930 .io = io, 1931 .allocator = allocator, 1932 .files = files, 1933 .metadata = metadata, 1934 .result = &result, 1935 }); 1936 return result; 1937 } 1938