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 {...@@ -1137,9 +1137,9 @@ pub const Repository = struct {
1137 if (cache_behavior == .cache) if (r.commits.get(id.id)) |val| {1137 if (cache_behavior == .cache) if (r.commits.get(id.id)) |val| {
1138 return .{ id, val };1138 return .{ id, val };
1139 };1139 };
1140 if (try r.getObject(id.id, .cache)) |obj| {1140 if (try r.getObject(id.id, .no_cache)) |obj| {
1141 if (obj.type == .commit) {1141 if (obj.type == .commit) {
1142 const raw = try r.gpa.dupe(u8, obj.content);1142 const raw = obj.content;
1143 errdefer r.gpa.free(raw);1143 errdefer r.gpa.free(raw);
1144 const commit = try r.gpa.create(Commit);1144 const commit = try r.gpa.create(Commit);
1145 errdefer r.gpa.destroy(commit);1145 errdefer r.gpa.destroy(commit);
...@@ -1147,6 +1147,7 @@ pub const Repository = struct {...@@ -1147,6 +1147,7 @@ pub const Repository = struct {
1147 if (cache_behavior == .cache) try r.commits.put(r.gpa, id.id, commit);1147 if (cache_behavior == .cache) try r.commits.put(r.gpa, id.id, commit);
1148 return .{ id, commit };1148 return .{ id, commit };
1149 }1149 }
1150 r.gpa.free(obj.content);
1150 }1151 }
1151 return null;1152 return null;
1152 }1153 }