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 {...@@ -15,7 +15,7 @@ pub fn getHEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !Id {
1515
16 if (std.mem.startsWith(u8, h, "ref:")) {16 if (std.mem.startsWith(u8, h, "ref:")) {
17 const r = blk: {17 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) {
19 error.FileNotFound => try std.fs.cwd().readFileAlloc(alloc, "/dev/null", 1024),19 error.FileNotFound => try std.fs.cwd().readFileAlloc(alloc, "/dev/null", 1024),
20 else => |e| return e,20 else => |e| return e,
21 };21 };
...@@ -49,6 +49,7 @@ pub fn getObject(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !string {...@@ -49,6 +49,7 @@ pub fn getObject(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !string {
49 .allocator = alloc,49 .allocator = alloc,
50 .cwd_dir = dir,50 .cwd_dir = dir,
51 .argv = &.{ "git", "cat-file", "-p", obj },51 .argv = &.{ "git", "cat-file", "-p", obj },
52 .max_output_bytes = 1024 * 1024 * 1024,
52 });53 });
53 return std.mem.trimRight(u8, result.stdout, "\n");54 return std.mem.trimRight(u8, result.stdout, "\n");
54}55}