╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ event.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1568 if (pending_parent_count == 0) { 1569 try self.ready_queue.append(.{ .bytes = &oid }); 1570 } else { 1571 try self.child_to_pending_parents.put(oid_int, .{ .uint = pending_parent_count }); 1572 } 1573 } 1574 } 1575 1576 fn enqueueChildren(self: *CommitIterator(repo_kind, repo_opts), oid: *const [hash.byteLen(repo_opts.hash)]u8) !void { 1577 const oid_int = hash.bytesToInt(repo_opts.hash, oid); 1578 const children_cursor = try self.parent_to_children.getCursor(oid_int) orelse return; 1579 const children = try DB.HashSet(.read_only).init(children_cursor); 1580 var children_iter = try children.iterator(); 1581 1582 while (try children_iter.next()) |*child_cursor| { 1583 const kv_pair = try child_cursor.readKeyValuePair(); 1584 const child_oid_int = kv_pair.hash; 1585 const pending_parent_cursor = try self.child_to_pending_parents.getCursor(child_oid_int) orelse return error.CursorNotFound; 1586 const pending_parent_count = try pending_parent_cursor.readUint(); 1587 1588 if (pending_parent_count <= 1) { 1589 _ = try self.child_to_pending_parents.remove(child_oid_int); 1590 const child_oid = hash.intToBytes(hash.HashInt(repo_opts.hash), child_oid_int); 1591 try self.ready_queue.append(.{ .bytes = &child_oid }); 1592 } else { 1593 try self.child_to_pending_parents.put(child_oid_int, .{ .uint = pending_parent_count - 1 }); 1594 } 1595 } 1596 } 1597 1598 fn readOidFromList(list: DB.ArrayList(.read_only), index: u64) ![hash.byteLen(repo_opts.hash)]u8 { 1599 const oid_cursor = try list.getCursor(index) orelse return error.CursorNotFound; 1600 var oid: [hash.byteLen(repo_opts.hash)]u8 = undefined; 1601 _ = try oid_cursor.readBytes(&oid); 1602 return oid; 1603 } 1604 }; 1605 } 1606