╭ changed ─────────────╮ │src/event/PatchRev.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │79 } │ │80 │ │81 // only show the depth difference if a short first-parent walk reaches the base│ │82 +// both oids must identify commits, not annotated tags │ │83 pub fn commitCount( │ │84 comptime repo_kind: rp.RepoKind, │ │85 comptime repo_opts: rp.RepoOpts(repo_kind), │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 94 .xit => { │ │ 95 const oid_len = comptime hash.hexLen(repo_opts.hash); │ │ 96 if (base_oid.len != oid_len or source_oid.len != oid_len) return error.InvalidOid; │ │ 96 - const base_count = try state.commitCount(io, allocator, .{ .oid = base_oid[0..oid_len] }); │ │ 97 - const source_count = try state.commitCount(io, allocator, .{ .oid = source_oid[0..oid_len] }); │ │ 98 - const count = std.math.sub(u64, source_count, base_count) catch return null; │ │ 97 + const base_stats = (try xit.patch.readCommitStats(repo_opts, state.extra.moment, base_oid[0..oid_len])) orelse return null; │ │ 98 + const source_stats = (try xit.patch.readCommitStats(repo_opts, state.extra.moment, source_oid[0..oid_len])) orelse return null;│ │ 99 + const count = std.math.sub(u64, source_stats.first_parent_depth, base_stats.first_parent_depth) catch return null; │ │100 if (count > commit_count_limit) return null; │ │101 │ │102 // depth subtraction is only valid if the base is on the source's first-parent chain │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯