authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-28 02:53:07 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-28 02:54:31 -07:00
log8242af7c61028c1b840b5d680b963a395b5d1100
treed10a52d3f9becc85a11b38ebf126bd8157f2bed8
parent1313631aae874c8fa83624cb9538118de62584e7
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

commits are rarely delta'd dont cache them in the window

linux / debug: found 41 in 934ms after searching 26126 commits TypeScript /tests/baselines/reference/ debug: found 53049 in 19914ms after searching 14270 commits

1 files changed, 3 insertions(+), 2 deletions(-)

git.zig+3-2
......@@ -1137,9 +1137,9 @@ pub const Repository = struct {
11371137 if (cache_behavior == .cache) if (r.commits.get(id.id)) |val| {
11381138 return .{ id, val };
11391139 };
1140 if (try r.getObject(id.id, .cache)) |obj| {
1140 if (try r.getObject(id.id, .no_cache)) |obj| {
11411141 if (obj.type == .commit) {
1142 const raw = try r.gpa.dupe(u8, obj.content);
1142 const raw = obj.content;
11431143 errdefer r.gpa.free(raw);
11441144 const commit = try r.gpa.create(Commit);
11451145 errdefer r.gpa.destroy(commit);
......@@ -1147,6 +1147,7 @@ pub const Repository = struct {
11471147 if (cache_behavior == .cache) try r.commits.put(r.gpa, id.id, commit);
11481148 return .{ id, commit };
11491149 }
1150 r.gpa.free(obj.content);
11501151 }
11511152 return null;
11521153 }