╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ patch.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
455 defer commits.deinit(); 456 if (!std.mem.allEqual(u8, &old_oid, '0')) try commits.exclude(&old_oid); 457 try commits.include(&new_oid); 458 var revision_key_buffer: [rf.MAX_REF_CONTENT_SIZE + 1 + hash.hexLen(repo_opts.hash)]u8 = undefined; 459 while (try commits.next(arena.allocator())) |commit| { 460 defer commit.deinit(); 461 const key = try std.fmt.bufPrint(&revision_key_buffer, "{s}\x00{s}", .{ update.ref_name[heads_prefix.len..], &commit.oid }); 462 const ids_cursor = try revisions.getCursor(hash.hashInt(repo_opts.hash, key)) orelse continue; 463 const ids = try DB.CountedHashSet(.read_only).init(ids_cursor); 464 var ids_iter = try ids.iterator(); 465 while (try ids_iter.next()) |cursor| { 466 const pair = try cursor.readKeyValuePair(); 467 var patch_id: [evt.event_id_size]u8 = undefined; 468 if ((try pair.key_cursor.readBytes(&patch_id)).len != patch_id.len) return error.InvalidPatch; 469 const patch_hex = std.fmt.bytesToHex(patch_id, .lower); 470 importMerged(repo_opts, state, db, moment, io, allocator, repo_root_path, &patch_id, &commit.oid) catch |err| { 471 serve_common.logError(io, error_writer, "failed to mark patch {s} as merged: {s}\n", .{ &patch_hex, @errorName(err) }); 472 continue; 473 }; 474 } 475 } 476 } 477 } 478