╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ event.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1033 if (pending_parent_count == 0) { 1034 try self.ready_queue.append(.{ .bytes = &oid }); 1035 } else { 1036 try self.child_to_pending_parents.put(oid_int, .{ .uint = pending_parent_count }); 1037 } 1038 } 1039 } 1040 1041 fn enqueueChildren(self: *CommitIterator(repo_opts), oid: *const [hash.byteLen(repo_opts.hash)]u8) !void { 1042 const oid_int = hash.bytesToInt(repo_opts.hash, oid); 1043 const children_cursor = try self.parent_to_children.getCursor(oid_int) orelse return; 1044 const children = try DB.HashSet(.read_only).init(children_cursor); 1045 var children_iter = try children.iterator(); 1046 1047 while (try children_iter.next()) |*child_cursor| { 1048 const kv_pair = try child_cursor.readKeyValuePair(); 1049 const child_oid_int = kv_pair.hash; 1050 const pending_parent_cursor = try self.child_to_pending_parents.getCursor(child_oid_int) orelse return error.CursorNotFound; 1051 const pending_parent_count = try pending_parent_cursor.readUint(); 1052 1053 if (pending_parent_count <= 1) { 1054 _ = try self.child_to_pending_parents.remove(child_oid_int); 1055 const child_oid = hash.intToBytes(hash.HashInt(repo_opts.hash), child_oid_int); 1056 try self.ready_queue.append(.{ .bytes = &child_oid }); 1057 } else { 1058 try self.child_to_pending_parents.put(child_oid_int, .{ .uint = pending_parent_count - 1 }); 1059 } 1060 } 1061 } 1062 1063 fn readOidFromList(list: DB.ArrayList(.read_only), index: u64) ![hash.byteLen(repo_opts.hash)]u8 { 1064 const oid_cursor = try list.getCursor(index) orelse return error.CursorNotFound; 1065 var oid: [hash.byteLen(repo_opts.hash)]u8 = undefined; 1066 _ = try oid_cursor.readBytes(&oid); 1067 return oid; 1068 } 1069 }; 1070 } 1071