| ... | @@ -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 { |
| 15 | | 15 | |
| 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 | } |