authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-24 14:27:58 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-24 14:27:58 -07:00
logc0da28486e36527301620e49c0c85a1aec11dcdd
tree819e8f4152bef9808d3825aa6b95de2ed0f764bd
parent1a34d5cddaa23cab20734da48b81cd305731ff9f
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

Repository.getObject: remove arena parameter


1 files changed, 46 insertions(+), 48 deletions(-)

git.zig+46-48
...@@ -740,6 +740,7 @@ pub const Repository = struct {...@@ -740,6 +740,7 @@ pub const Repository = struct {
740 r.unpacked_loose_objects.deinit(r.gpa);740 r.unpacked_loose_objects.deinit(r.gpa);
741 for (r.unpacked_objects.values()) |v| r.gpa.free(v.content);741 for (r.unpacked_objects.values()) |v| r.gpa.free(v.content);
742 r.unpacked_objects.deinit(r.gpa);742 r.unpacked_objects.deinit(r.gpa);
743 for (r.idx_content.keys()) |k| r.gpa.free(k);
743 for (r.idx_content.values()) |v| nfs.munmap(v);744 for (r.idx_content.values()) |v| nfs.munmap(v);
744 r.idx_content.deinit(r.gpa);745 r.idx_content.deinit(r.gpa);
745 for (r.pack_content.values()) |v| nfs.munmap(v);746 for (r.pack_content.values()) |v| nfs.munmap(v);
...@@ -751,7 +752,7 @@ pub const Repository = struct {...@@ -751,7 +752,7 @@ pub const Repository = struct {
751 r.tags.deinit(r.gpa);752 r.tags.deinit(r.gpa);
752 }753 }
753754
754 pub fn getObject(r: *Repository, arena: std.mem.Allocator, oid: Id, cache_behavior: CacheBehavior) anyerror!?GitObject {755 pub fn getObject(r: *Repository, oid: Id, cache_behavior: CacheBehavior) anyerror!?GitObject {
755 const t = tracer.trace(@src(), " {s}", .{oid});756 const t = tracer.trace(@src(), " {s}", .{oid});
756 defer t.end();757 defer t.end();
757758
...@@ -807,14 +808,14 @@ pub const Repository = struct {...@@ -807,14 +808,14 @@ pub const Repository = struct {
807 errdefer nfs.munmap(idx_content);808 errdefer nfs.munmap(idx_content);
808 try r.idx_content.put(809 try r.idx_content.put(
809 r.gpa,810 r.gpa,
810 try arena.dupe(u8, entry.name),811 try r.gpa.dupe(u8, entry.name),
811 idx_content,812 idx_content,
812 );813 );
813 }814 }
814 }815 }
815 const pack_index, const pack_offset = try r.getObjectPackIndex(oid) orelse return null;816 const pack_index, const pack_offset = try r.getObjectPackIndex(oid) orelse return null;
816 // parse .pack817 // parse .pack
817 return try r.getPackedObject(arena, oid, pack_index, pack_offset, cache_behavior);818 return try r.getPackedObject(oid, pack_index, pack_offset, cache_behavior);
818 }819 }
819820
820 fn getObjectPackIndex(r: *Repository, oid: Id) !?[2]usize {821 fn getObjectPackIndex(r: *Repository, oid: Id) !?[2]usize {
...@@ -876,7 +877,7 @@ pub const Repository = struct {...@@ -876,7 +877,7 @@ pub const Repository = struct {
876 return null;877 return null;
877 }878 }
878879
879 fn getPackedObject(r: *Repository, arena: std.mem.Allocator, maybe_oid: ?Id, pack_index: usize, pack_offset: usize, cache_behavior: CacheBehavior) !GitObject {880 fn getPackedObject(r: *Repository, maybe_oid: ?Id, pack_index: usize, pack_offset: usize, cache_behavior: CacheBehavior) !GitObject {
880 const t = tracer.trace(@src(), " {?s} {d} {d} {s}", .{ maybe_oid, pack_index, pack_offset, r.pack_content.keys()[pack_index] });881 const t = tracer.trace(@src(), " {?s} {d} {d} {s}", .{ maybe_oid, pack_index, pack_offset, r.pack_content.keys()[pack_index] });
881 defer t.end();882 defer t.end();
882883
...@@ -932,13 +933,13 @@ pub const Repository = struct {...@@ -932,13 +933,13 @@ pub const Repository = struct {
932 offset += 1;933 offset += 1;
933 }934 }
934 const base_pack_offset = pack_offset - offset;935 const base_pack_offset = pack_offset - offset;
935 const base_obj = try r.getPackedObject(arena, null, pack_index, base_pack_offset, cache_behavior);936 const base_obj = try r.getPackedObject(null, pack_index, base_pack_offset, cache_behavior);
936 defer if (cache_behavior == .no_cache) r.gpa.free(base_obj.content);937 defer if (cache_behavior == .no_cache) r.gpa.free(base_obj.content);
937 return r.getDeltadObject(maybe_oid, key, &packedobj_fbs, size, base_obj, cache_behavior);938 return r.getDeltadObject(maybe_oid, key, &packedobj_fbs, size, base_obj, cache_behavior);
938 },939 },
939 .ref_delta => {940 .ref_delta => {
940 const base_oid = extras.to_hex(packedobj_fbs.takeSlice(20)[0..20].*);941 const base_oid = extras.to_hex(packedobj_fbs.takeSlice(20)[0..20].*);
941 const base_obj = (try r.getObject(arena, &base_oid, cache_behavior)).?;942 const base_obj = (try r.getObject(&base_oid, cache_behavior)).?;
942 defer if (cache_behavior == .no_cache) r.gpa.free(base_obj.content);943 defer if (cache_behavior == .no_cache) r.gpa.free(base_obj.content);
943 return r.getDeltadObject(maybe_oid, key, &packedobj_fbs, size, base_obj, cache_behavior);944 return r.getDeltadObject(maybe_oid, key, &packedobj_fbs, size, base_obj, cache_behavior);
944 },945 },
...@@ -1024,16 +1025,16 @@ pub const Repository = struct {...@@ -1024,16 +1025,16 @@ pub const Repository = struct {
1024 return obj;1025 return obj;
1025 }1026 }
10261027
1027 pub fn getObjectA(r: *Repository, arena: std.mem.Allocator, oid: Id, cache_behavior: CacheBehavior) !GitObject {1028 pub fn getObjectA(r: *Repository, oid: Id, cache_behavior: CacheBehavior) !GitObject {
1028 return (try r.getObject(arena, oid, cache_behavior)).?;1029 return (try r.getObject(oid, cache_behavior)).?;
1029 }1030 }
10301031
1031 pub fn getObjectC(r: *Repository, arena: std.mem.Allocator, oid: Id, cache_behavior: CacheBehavior) ![]const u8 {1032 pub fn getObjectC(r: *Repository, oid: Id, cache_behavior: CacheBehavior) ![]const u8 {
1032 return (try r.getObjectA(arena, oid, cache_behavior)).content;1033 return (try r.getObjectA(oid, cache_behavior)).content;
1033 }1034 }
10341035
1035 pub fn getObjectS(r: *Repository, arena: std.mem.Allocator, oid: Id, cache_behavior: CacheBehavior) !usize {1036 pub fn getObjectS(r: *Repository, oid: Id, cache_behavior: CacheBehavior) !usize {
1036 const content = try r.getObjectC(arena, oid, cache_behavior);1037 const content = try r.getObjectC(oid, cache_behavior);
1037 defer if (cache_behavior == .no_cache) r.gpa.free(content);1038 defer if (cache_behavior == .no_cache) r.gpa.free(content);
1038 return content.len;1039 return content.len;
1039 }1040 }
...@@ -1043,8 +1044,8 @@ pub const Repository = struct {...@@ -1043,8 +1044,8 @@ pub const Repository = struct {
1043 content: []const u8,1044 content: []const u8,
1044 };1045 };
10451046
1046 pub fn getBlob(r: *Repository, arena: std.mem.Allocator, id: BlobId, cache_behavior: CacheBehavior) !?[]const u8 {1047 pub fn getBlob(r: *Repository, id: BlobId, cache_behavior: CacheBehavior) !?[]const u8 {
1047 if (try r.getObject(arena, id.id, cache_behavior)) |obj| {1048 if (try r.getObject(id.id, cache_behavior)) |obj| {
1048 if (obj.type == .blob) {1049 if (obj.type == .blob) {
1049 return obj.content;1050 return obj.content;
1050 }1051 }
...@@ -1053,18 +1054,18 @@ pub const Repository = struct {...@@ -1053,18 +1054,18 @@ pub const Repository = struct {
1053 return null;1054 return null;
1054 }1055 }
10551056
1056 pub fn getBlobA(r: *Repository, arena: std.mem.Allocator, id: Id, cache_behavior: CacheBehavior) ![]const u8 {1057 pub fn getBlobA(r: *Repository, id: Id, cache_behavior: CacheBehavior) ![]const u8 {
1057 return (try r.getBlob(arena, .{ .id = id }, cache_behavior)).?;1058 return (try r.getBlob(.{ .id = id }, cache_behavior)).?;
1058 }1059 }
10591060
1060 pub fn getCommit(r: *Repository, arena: std.mem.Allocator, id: CommitId) !?struct { CommitId, CommitIdx } {1061 pub fn getCommit(r: *Repository, id: CommitId) !?struct { CommitId, CommitIdx } {
1061 const t = tracer.trace(@src(), " {s}", .{id.id});1062 const t = tracer.trace(@src(), " {s}", .{id.id});
1062 defer t.end();1063 defer t.end();
10631064
1064 if (r.commits.getIndex(id.id)) |idx| {1065 if (r.commits.getIndex(id.id)) |idx| {
1065 return .{ id, @enumFromInt(idx) };1066 return .{ id, @enumFromInt(idx) };
1066 }1067 }
1067 if (try r.getObject(arena, id.id, .cache)) |obj| {1068 if (try r.getObject(id.id, .cache)) |obj| {
1068 if (obj.type == .commit) {1069 if (obj.type == .commit) {
1069 const commit = try parseCommit(r.gpa, obj.content);1070 const commit = try parseCommit(r.gpa, obj.content);
1070 try r.commits.put(r.gpa, id.id, commit);1071 try r.commits.put(r.gpa, id.id, commit);
...@@ -1075,18 +1076,18 @@ pub const Repository = struct {...@@ -1075,18 +1076,18 @@ pub const Repository = struct {
1075 return null;1076 return null;
1076 }1077 }
10771078
1078 pub fn getCommitA(r: *Repository, arena: std.mem.Allocator, id: Id) !CommitIdx {1079 pub fn getCommitA(r: *Repository, id: Id) !CommitIdx {
1079 return (try r.getCommit(arena, .{ .id = id })).?.@"1";1080 return (try r.getCommit(.{ .id = id })).?.@"1";
1080 }1081 }
10811082
1082 pub fn getTree(r: *Repository, arena: std.mem.Allocator, id: TreeId, cache_behavior: CacheBehavior) !?struct { TreeId, Tree } {1083 pub fn getTree(r: *Repository, id: TreeId, cache_behavior: CacheBehavior) !?struct { TreeId, Tree } {
1083 const t = tracer.trace(@src(), " {s}", .{id.id});1084 const t = tracer.trace(@src(), " {s}", .{id.id});
1084 defer t.end();1085 defer t.end();
10851086
1086 if (r.trees.getPtr(id.id)) |val| {1087 if (r.trees.getPtr(id.id)) |val| {
1087 return .{ id, val.* };1088 return .{ id, val.* };
1088 }1089 }
1089 if (try r.getObject(arena, id.id, cache_behavior)) |obj| {1090 if (try r.getObject(id.id, cache_behavior)) |obj| {
1090 if (obj.type == .tree) {1091 if (obj.type == .tree) {
1091 errdefer if (cache_behavior == .no_cache) r.gpa.free(obj.content);1092 errdefer if (cache_behavior == .no_cache) r.gpa.free(obj.content);
1092 var children: std.ArrayList(Tree.Object) = .empty;1093 var children: std.ArrayList(Tree.Object) = .empty;
...@@ -1136,18 +1137,18 @@ pub const Repository = struct {...@@ -1136,18 +1137,18 @@ pub const Repository = struct {
1136 return null;1137 return null;
1137 }1138 }
11381139
1139 pub fn getTreeA(r: *Repository, arena: std.mem.Allocator, id: Id, cache_behavior: CacheBehavior) !Tree {1140 pub fn getTreeA(r: *Repository, id: Id, cache_behavior: CacheBehavior) !Tree {
1140 return (try r.getTree(arena, .{ .id = id }, cache_behavior)).?.@"1";1141 return (try r.getTree(.{ .id = id }, cache_behavior)).?.@"1";
1141 }1142 }
11421143
1143 pub fn getTag(r: *Repository, arena: std.mem.Allocator, id: TagId, cache_behavior: CacheBehavior) !?struct { TagId, Tag } {1144 pub fn getTag(r: *Repository, id: TagId, cache_behavior: CacheBehavior) !?struct { TagId, Tag } {
1144 const t = tracer.trace(@src(), " {s}", .{id.id});1145 const t = tracer.trace(@src(), " {s}", .{id.id});
1145 defer t.end();1146 defer t.end();
11461147
1147 if (r.tags.getPtr(id.id)) |val| {1148 if (r.tags.getPtr(id.id)) |val| {
1148 return .{ id, val.* };1149 return .{ id, val.* };
1149 }1150 }
1150 if (try r.getObject(arena, id.id, cache_behavior)) |obj| {1151 if (try r.getObject(id.id, cache_behavior)) |obj| {
1151 if (obj.type == .tag) {1152 if (obj.type == .tag) {
1152 errdefer if (cache_behavior == .no_cache) r.gpa.free(obj.content);1153 errdefer if (cache_behavior == .no_cache) r.gpa.free(obj.content);
1153 const tag = try parseTag(obj.content);1154 const tag = try parseTag(obj.content);
...@@ -1159,8 +1160,8 @@ pub const Repository = struct {...@@ -1159,8 +1160,8 @@ pub const Repository = struct {
1159 return null;1160 return null;
1160 }1161 }
11611162
1162 pub fn getTagA(r: *Repository, arena: std.mem.Allocator, id: Id, cache_behavior: CacheBehavior) !Tag {1163 pub fn getTagA(r: *Repository, id: Id, cache_behavior: CacheBehavior) !Tag {
1163 return (try r.getTag(arena, .{ .id = id }, cache_behavior)).?.@"1";1164 return (try r.getTag(.{ .id = id }, cache_behavior)).?.@"1";
1164 }1165 }
11651166
1166 pub fn getHeads(r: *Repository, arena: std.mem.Allocator) ![]Ref {1167 pub fn getHeads(r: *Repository, arena: std.mem.Allocator) ![]Ref {
...@@ -1239,10 +1240,10 @@ pub const Repository = struct {...@@ -1239,10 +1240,10 @@ pub const Repository = struct {
12391240
1240 // const start = time.milliTimestamp();1241 // const start = time.milliTimestamp();
12411242
1242 const base_idx = try r.getCommitA(arena, base_oid.id);1243 const base_idx = try r.getCommitA(base_oid.id);
1243 const base = base_idx.reify(r);1244 const base = base_idx.reify(r);
1244 const base_tree_id = (try traverseTo(r, arena, base.tree, dir_path)).?;1245 const base_tree_id = (try traverseTo(r, base.tree, dir_path)).?;
1245 const base_tree = try r.getTreeA(arena, base_tree_id.id, .cache);1246 const base_tree = try r.getTreeA(base_tree_id.id, .cache);
1246 const total = base_tree.children.len;1247 const total = base_tree.children.len;
12471248
1248 var found: usize = 0;1249 var found: usize = 0;
...@@ -1261,11 +1262,11 @@ pub const Repository = struct {...@@ -1261,11 +1262,11 @@ pub const Repository = struct {
1261 var tree_id = base_tree_id;1262 var tree_id = base_tree_id;
1262 while (true) {1263 while (true) {
1263 if (commit.parents.len == 0) break;1264 if (commit.parents.len == 0) break;
1264 commit_id, commit_idx = (try r.getCommit(arena, commit.parents[0])).?;1265 commit_id, commit_idx = (try r.getCommit(commit.parents[0])).?;
1265 searched += 1;1266 searched += 1;
1266 defer commit_id_prev = commit_id;1267 defer commit_id_prev = commit_id;
1267 commit = commit_idx.reify(r);1268 commit = commit_idx.reify(r);
1268 const new_tree_id = try traverseTo(r, arena, commit.tree, dir_path) orelse {1269 const new_tree_id = try traverseTo(r, commit.tree, dir_path) orelse {
1269 var i: usize = 0;1270 var i: usize = 0;
1270 while (findFirstUnset(set, i)) |j| : (i += 1) {1271 while (findFirstUnset(set, i)) |j| : (i += 1) {
1271 i = j;1272 i = j;
...@@ -1280,7 +1281,7 @@ pub const Repository = struct {...@@ -1280,7 +1281,7 @@ pub const Repository = struct {
1280 };1281 };
1281 if (new_tree_id.eql(tree_id)) continue;1282 if (new_tree_id.eql(tree_id)) continue;
1282 tree_id = new_tree_id;1283 tree_id = new_tree_id;
1283 const tree = try r.getTreeA(arena, tree_id.id, .cache);1284 const tree = try r.getTreeA(tree_id.id, .cache);
1284 var i: usize = 0;1285 var i: usize = 0;
1285 while (findFirstUnset(set, i)) |j| : (i += 1) {1286 while (findFirstUnset(set, i)) |j| : (i += 1) {
1286 i = j;1287 i = j;
...@@ -1323,7 +1324,7 @@ pub const Repository = struct {...@@ -1323,7 +1324,7 @@ pub const Repository = struct {
1323 try S.item(e, w, .none, mode, &@splat('0'), id, .A, p, name);1324 try S.item(e, w, .none, mode, &@splat('0'), id, .A, p, name);
1324 }1325 }
1325 fn dir(e: *Repository, w: anytype, t: Id, p: ?*const PathListNode, o: usize) !void {1326 fn dir(e: *Repository, w: anytype, t: Id, p: ?*const PathListNode, o: usize) !void {
1326 const tree = try e.getTreeA(e.gpa, t, .cache);1327 const tree = try e.getTreeA(t, .cache);
1327 for (tree.children[o..]) |obj| {1328 for (tree.children[o..]) |obj| {
1328 if (obj.mode.type == .directory) {1329 if (obj.mode.type == .directory) {
1329 try dir(e, w, obj.id.tree.id, &.{ .prev = p, .data = obj.name }, 0);1330 try dir(e, w, obj.id.tree.id, &.{ .prev = p, .data = obj.name }, 0);
...@@ -1344,7 +1345,7 @@ pub const Repository = struct {...@@ -1344,7 +1345,7 @@ pub const Repository = struct {
1344 try S.item(e, w, mode, .none, id, &@splat('0'), .D, p, name);1345 try S.item(e, w, mode, .none, id, &@splat('0'), .D, p, name);
1345 }1346 }
1346 fn dir(e: *Repository, w: anytype, t: Id, p: ?*const PathListNode, o: usize) !void {1347 fn dir(e: *Repository, w: anytype, t: Id, p: ?*const PathListNode, o: usize) !void {
1347 const tree = try e.getTreeA(e.gpa, t, .cache);1348 const tree = try e.getTreeA(t, .cache);
1348 for (tree.children[o..]) |obj| {1349 for (tree.children[o..]) |obj| {
1349 if (obj.mode.type == .directory) {1350 if (obj.mode.type == .directory) {
1350 try dir(e, w, obj.id.tree.id, &.{ .prev = p, .data = obj.name }, 0);1351 try dir(e, w, obj.id.tree.id, &.{ .prev = p, .data = obj.name }, 0);
...@@ -1363,11 +1364,11 @@ pub const Repository = struct {...@@ -1363,11 +1364,11 @@ pub const Repository = struct {
1363 const M = struct {1364 const M = struct {
1364 fn dir(e: *Repository, w: anytype, b_t: Id, a_t: Id, p: ?*const PathListNode) !void {1365 fn dir(e: *Repository, w: anytype, b_t: Id, a_t: Id, p: ?*const PathListNode) !void {
1365 var before_i: usize = 0;1366 var before_i: usize = 0;
1366 const before_tree = try e.getTreeA(e.gpa, b_t, .cache);1367 const before_tree = try e.getTreeA(b_t, .cache);
1367 const before_children = before_tree.children;1368 const before_children = before_tree.children;
13681369
1369 var after_i: usize = 0;1370 var after_i: usize = 0;
1370 const after_tree = try e.getTreeA(e.gpa, a_t, .cache);1371 const after_tree = try e.getTreeA(a_t, .cache);
1371 const after_children = after_tree.children;1372 const after_children = after_tree.children;
13721373
1373 while (true) {1374 while (true) {
...@@ -1508,14 +1509,14 @@ pub const Repository = struct {...@@ -1508,14 +1509,14 @@ pub const Repository = struct {
1508 }1509 }
1509 };1510 };
1510 if (commitid_from == null) {1511 if (commitid_from == null) {
1511 const commitidx = try r.getCommitA(r.gpa, commitid_to.id);1512 const commitidx = try r.getCommitA(commitid_to.id);
1512 const commit = commitidx.reify(r);1513 const commit = commitidx.reify(r);
1513 try A.dir(r, writable, commit.tree.id, null, 0);1514 try A.dir(r, writable, commit.tree.id, null, 0);
1514 return;1515 return;
1515 }1516 }
1516 const before_commitidx = try r.getCommitA(r.gpa, commitid_from.?.id);1517 const before_commitidx = try r.getCommitA(commitid_from.?.id);
1517 const before_commit = before_commitidx.reify(r);1518 const before_commit = before_commitidx.reify(r);
1518 const after_commitidx = try r.getCommitA(r.gpa, commitid_to.id);1519 const after_commitidx = try r.getCommitA(commitid_to.id);
1519 const after_commit = after_commitidx.reify(r);1520 const after_commit = after_commitidx.reify(r);
1520 try M.dir(r, writable, before_commit.tree.id, after_commit.tree.id, null);1521 try M.dir(r, writable, before_commit.tree.id, after_commit.tree.id, null);
1521 }1522 }
...@@ -1633,12 +1634,12 @@ const ZlibCode = enum(c_int) {...@@ -1633,12 +1634,12 @@ const ZlibCode = enum(c_int) {
1633 Z_VERSION_ERROR = -6,1634 Z_VERSION_ERROR = -6,
1634};1635};
16351636
1636fn traverseTo(r: *Repository, arena: std.mem.Allocator, treestart_id: TreeId, dir_path: []const u8) !?TreeId {1637fn traverseTo(r: *Repository, treestart_id: TreeId, dir_path: []const u8) !?TreeId {
1637 var id = treestart_id;1638 var id = treestart_id;
1638 if (dir_path.len == 0) return id;1639 if (dir_path.len == 0) return id;
1639 var iter = std.mem.splitScalar(u8, dir_path, '/');1640 var iter = std.mem.splitScalar(u8, dir_path, '/');
1640 while (iter.next()) |segment| {1641 while (iter.next()) |segment| {
1641 const tree = try r.getTreeA(arena, id.id, .cache);1642 const tree = try r.getTreeA(id.id, .cache);
1642 const o = tree.get(segment) orelse return null;1643 const o = tree.get(segment) orelse return null;
1643 if (o.id != .tree) return null;1644 if (o.id != .tree) return null;
1644 id = o.id.tree;1645 id = o.id.tree;
...@@ -1846,7 +1847,7 @@ pub const Tree = struct {...@@ -1846,7 +1847,7 @@ pub const Tree = struct {
1846 };1847 };
1847 };1848 };
18481849
1849 pub fn walk(self: Tree, r: *Repository, arena: std.mem.Allocator) !Walker {1850 pub fn walk(self: Tree, r: *Repository) !Walker {
1850 var stack: std.ArrayListUnmanaged(Walker.StackItem) = .empty;1851 var stack: std.ArrayListUnmanaged(Walker.StackItem) = .empty;
18511852
1852 try stack.append(r.gpa, .{1853 try stack.append(r.gpa, .{
...@@ -1856,7 +1857,6 @@ pub const Tree = struct {...@@ -1856,7 +1857,6 @@ pub const Tree = struct {
1856 });1857 });
1857 return .{1858 return .{
1858 .repo = r,1859 .repo = r,
1859 .arena = arena,
1860 .stack = stack,1860 .stack = stack,
1861 .name_buffer = .empty,1861 .name_buffer = .empty,
1862 };1862 };
...@@ -1864,7 +1864,6 @@ pub const Tree = struct {...@@ -1864,7 +1864,6 @@ pub const Tree = struct {
18641864
1865 pub const Walker = struct {1865 pub const Walker = struct {
1866 repo: *Repository,1866 repo: *Repository,
1867 arena: std.mem.Allocator,
1868 stack: std.ArrayListUnmanaged(StackItem),1867 stack: std.ArrayListUnmanaged(StackItem),
1869 name_buffer: std.ArrayListUnmanaged(u8),1868 name_buffer: std.ArrayListUnmanaged(u8),
18701869
...@@ -1881,7 +1880,6 @@ pub const Tree = struct {...@@ -1881,7 +1880,6 @@ pub const Tree = struct {
18811880
1882 pub fn next(self: *Walker) !?Walker.Entry {1881 pub fn next(self: *Walker) !?Walker.Entry {
1883 const gpa = self.repo.gpa;1882 const gpa = self.repo.gpa;
1884 const arena = self.arena;
1885 while (self.stack.items.len != 0) {1883 while (self.stack.items.len != 0) {
1886 var top = &self.stack.items[self.stack.items.len - 1];1884 var top = &self.stack.items[self.stack.items.len - 1];
1887 var containing = top;1885 var containing = top;
...@@ -1898,7 +1896,7 @@ pub const Tree = struct {...@@ -1898,7 +1896,7 @@ pub const Tree = struct {
1898 self.name_buffer.appendSliceAssumeCapacity(base.name);1896 self.name_buffer.appendSliceAssumeCapacity(base.name);
1899 self.name_buffer.appendAssumeCapacity(0);1897 self.name_buffer.appendAssumeCapacity(0);
1900 if (base.id == .tree) {1898 if (base.id == .tree) {
1901 const new_tree = try self.repo.getTreeA(arena, base.id.tree.id, .cache);1899 const new_tree = try self.repo.getTreeA(base.id.tree.id, .cache);
1902 {1900 {
1903 // errdefer new_dir.close();1901 // errdefer new_dir.close();
1904 try self.stack.append(gpa, .{1902 try self.stack.append(gpa, .{