From c7920b30138b457fccc0a3d155b0e2742de52325 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Mon, 1 May 2023 19:08:30 -0700 Subject: [PATCH] increase file read max size --- git.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git.zig b/git.zig index 8b40329efebd141126c2e067040e2762b2864324..50b83ef4974902f5e19544a7e2c37dbf16cabf3c 100644 --- a/git.zig +++ b/git.zig @@ -15,7 +15,7 @@ pub fn getHEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !Id { if (std.mem.startsWith(u8, h, "ref:")) { const r = blk: { - const pckedrfs = dir.readFileAlloc(alloc, "packed-refs", 1024 * 1024) catch |err| switch (err) { + const pckedrfs = dir.readFileAlloc(alloc, "packed-refs", 1024 * 1024 * 1024) catch |err| switch (err) { error.FileNotFound => try std.fs.cwd().readFileAlloc(alloc, "/dev/null", 1024), else => |e| return e, }; @@ -49,6 +49,7 @@ pub fn getObject(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !string { .allocator = alloc, .cwd_dir = dir, .argv = &.{ "git", "cat-file", "-p", obj }, + .max_output_bytes = 1024 * 1024 * 1024, }); return std.mem.trimRight(u8, result.stdout, "\n"); } -- 2.54.0