authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-05-01 19:08:30 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-05-01 19:08:30 -07:00
logc7920b30138b457fccc0a3d155b0e2742de52325
tree60f3d94446252219fa28953510cdcfaa16ac9051
parent3584fa7b4fc76fda454bffe5b5491e2b3f6fc9bb

increase file read max size


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

git.zig+2-1
......@@ -15,7 +15,7 @@ pub fn getHEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !Id {
1515
1616 if (std.mem.startsWith(u8, h, "ref:")) {
1717 const r = blk: {
18 const pckedrfs = dir.readFileAlloc(alloc, "packed-refs", 1024 * 1024) catch |err| switch (err) {
18 const pckedrfs = dir.readFileAlloc(alloc, "packed-refs", 1024 * 1024 * 1024) catch |err| switch (err) {
1919 error.FileNotFound => try std.fs.cwd().readFileAlloc(alloc, "/dev/null", 1024),
2020 else => |e| return e,
2121 };
......@@ -49,6 +49,7 @@ pub fn getObject(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !string {
4949 .allocator = alloc,
5050 .cwd_dir = dir,
5151 .argv = &.{ "git", "cat-file", "-p", obj },
52 .max_output_bytes = 1024 * 1024 * 1024,
5253 });
5354 return std.mem.trimRight(u8, result.stdout, "\n");
5455}